Reputation: 23
The probleming code:
<%= if flash[:notice] %>
<div class="notification is-primary global-notification">
<p class="notice"><%= notice %></p>
</div>
<% end %>
<%= if flash[:alert] %>
<div class="notification is-danger global-notification">
<p class="alert"><%= alert %></p>
</div>
<% end %>
And when running my server the following error drops:
Already changed the syntax to: if (flash[:notice])
. But still, drop this. Any idea?
Upvotes: 1
Views: 211
Reputation: 5972
<%= if flash[:notice] %>
The above code should be:
<% if flash[:notice] %>
Note
<% %>
- Executes the ruby code within the brackets.
<%= %>
- Prints something into ERB file.
Upvotes: 6