Discussion: Code Reduction
Afficher un message
Vieux 21/02/2008, 15h56   #1
Jigar Gosar
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Code Reduction

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.
--
Posted via http://www.ruby-forum.com/.

  Réponse avec citation
 
Page generated in 0,04771 seconds with 9 queries