-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
render_flash is never called #2
Comments
Everything appears to be working on my demo app. Are you able to reproduce with an example app that I could take a peak at? |
I can try to create one yes. FWIW, this is the controller action (if the "else" block gets executed, no flash is displayed) def create
result = Scraper::ArtistScraper.new(params[:code]).scrape
if result.valid?
if Artist.find_by(code: result.artist[:code]).present?
redirect_to new_artist_scraper_path, alert: I18n.t('artist_scrapers.create.exists')
else
@artist_scraper = result.artist
end
else
redirect_to new_artist_scraper_path, alert: result.message
end
end |
Ahhh on a redirect. So hotflash only works with actions that render. Are you rendering a flash in your layout? |
yes - application.html.erb: <body>
<%= render 'shared/navbar' %>
<section class="section m-0 p-0">
<layout-container class="container">
<layout-columns class="columns p-1 mb-1">
<%= render 'shared/sidebar' if current_user %>
<main class="column m-1 px-5 py-3 is-relative">
<%= render 'shared/flashes' %>
<%= yield %>
</main>
</layout-columns>
</layout-container>
</section>
<%= render 'shared/footer' %>
</body> |
Digging into this: Is the POST request a turbo request? |
Yes as per the console, it's processed as TURBO_STREAM. |
Have you tried hitting |
hi @joshmn , so the redirect not support yet or any tips for it? |
I just installed this into my little rails app but the flashes behaviour did not change.
I added a binding.pry into the render_flash helper method (right at the beginning) but it looks like this method is never called.
I have included the before_action line into my application controller. What else could be the root cause?
The text was updated successfully, but these errors were encountered: