I'm in Rails 4 using Bootstrap
This is my create action in my controller:
def create
@contest = Contest.new(contest_params)
if @contest.save
flash[:notice] = "Contest saved successfully"
redirect_to @contest
else
redirect_to root_path, :notice => 'Project not saved'
end
end
How come there is no notice when I submit the form? Is there something I am missing? I'm a beginner and have not been able to figure this out.
I have the following in my layout already:
<body>
<p class="notice"><%= flash[:notice] %></p>
<p class="alert"><%= flash[:alert] %></p>
<%= render 'layouts/header' %>
<%= yield %>
<%= render 'layouts/footer' %>
</body>