I'm following Michael Hartl's Rails 5 Tutorial online. I'm on the Toy App portion. I have a simple User scaffold in place. When I create a new user, I'm redirected to the show template, but the flash notice message content isn't being displayed.
The controller code is as follows:
def create
@user = User.new(user_params)
respond_to do |format|
if @user.save
format.html { redirect_to @user, notice: 'User was successfully created.' }
end
end
end
The view code is here:
<p id="notice"><%= notice %></p>
The P element is being created and receiving the appropriate CSS styles, but the message isn't being passed to it.
Basically, I'm getting this for my output:
<p id="notice"></p>
I added this to the view:
<% if flash[:notice].blank? %>
<h1> flash notice is blank </h1>
<% end %>
...and I am getting the message that the flash notice is blank.
I'm on Rails 5.0.0.1 and Ruby 1.3.2. Thank you.