J
Jigar Gosar
I am using ERB templates in my code. It seems too big, can't get my head
around on how to reduce it. I am sure this can be made smaller. My
problem is that if there ain't any flash messages than the contained
HTML shouldn't be rendered at all.
<% if flash[:notice] %>
<div class="MessageWrapper">
<span class="Message">
<%= flash[:notice] %>
</span>
</div>
<% end %>
<% if flash[:error] %>
<div class="MessageWrapper">
<span class="ErrorMessage">
<%= flash[:error] %>
</span>
</div>
<% end %>
thanks.
around on how to reduce it. I am sure this can be made smaller. My
problem is that if there ain't any flash messages than the contained
HTML shouldn't be rendered at all.
<% if flash[:notice] %>
<div class="MessageWrapper">
<span class="Message">
<%= flash[:notice] %>
</span>
</div>
<% end %>
<% if flash[:error] %>
<div class="MessageWrapper">
<span class="ErrorMessage">
<%= flash[:error] %>
</span>
</div>
<% end %>
thanks.