Cool, thanks.
The "if v" can be removed, cause if the key exists than there is no
problem in rendering its value.
Thanks a lot, that was a really quick reply.
I just love ruby, cause so much can be expressed in so less.
Arlen Cuss wrote:
> Hey,
>
> If you call your CSS class for a `notice' flash NoticeMessage isntead of
> just Message, you can make it simple like this:
>
> <% flash.each do |k, v| %>
> <% if v %>
> <div class="MessageWrapper">
> <span class="<%= k.to_s.capitalize %>Message">
> <%= v %>
> </span>
> </div>
> <% end %>
> <% end %>
>
> Cheers,
> Arlen.
--
Posted via
http://www.ruby-forum.com/.