Josh wrote:
>> def conditional_element(name)
>> element = yield(name.to_sym)
>> content_tag(:div, element, :id => name.to_s) if element
>> end
>
> I might could get something like that to work. Basically I am just
> looking for a way to check and see if there is content for a specific
> area and adjust my markup, ids and classes accordingly.
>
> Say I have a 3 column layout, and if there is no sidebar content, i
> want to be able to check and render a 2 column layout instead.
Sounds like you're trying to squeeze two templates into one with a
resulting mess of conditional logic in the template. Perhaps it would be
easier to just make two templates and then select the corresponding
template from the controller dynamically? Or maybe I'm still not totally
clear on what you're trying to achieve ;)
--
Cheers,
- Jacob Atzen
--~--~---------~--~----~------------~-------~--~----~
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@...
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@...
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en-~----------~----~----~----~------~----~------~--~---