I have a minor issue I can't seem to figure out.
Regular flash works just as intended.
flash[:test] = 'Blarrgh'
redirect_to etcs_url
Will display 'Blarrgh' since I have this code in my application.html.erb
<% if flash[:test] %>
<%= flash[:test] %>
<% elsif flash.now[:test] %>
<%= flash.now[:test] %>
<% end %>
I'm pretty sure the way to display flash.now[:test] messages is just flash[:test], but I added the elsif in the bottom just in case since things weren't working.
For some reason, when I do
flash.now[:test] = 'Blarrgh'
render :edit
Nothing shows up at all. But when I put a 'fail' statement into my view then check out the values, flash[:test]/flash.now[:test] will have the proper values. E.g, ['Etc can't be blank']
I tried checking out common errors: no CSRF token, hidden redirect, flash.now b4 render, using form_with without local:true, but looking at my logs, there's no such issue. I included the CSRF token and my log path is
In logs:
patch /etc/1
(Commit fails, rolls back)
renders application.html.erb which yields etcs/edit.html.erb which renders etcs/_form.html.erb, then renders rest of etcs/edit.html.erb
And I'm putting my flash.now b4 the render. I'm also not using Rails helper functions like form_with.