On Jan 4, 2009, at 8:47 PM, James Englert wrote:

> Just confirming, its expensive since it renders the yield twice,  
> correct?  What if i did something like:
>
> <% yield_contents  = yield(:submenu)
>       if !yield_contents.strip.blank? -%>
>   <div class="submenu">
>     <%= yield_contents %>
>   </div>
> <% end -%>

That should work. A different solution altogether would be to have the  
submenu contain the div wrapper so you can make the test there and  
eliminate all the gnarly logic in your layout.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to