Hi All,
I have some partials that need to be rendered a bit differently
depending on the context. To make matters worse, sometimes these
partials are including other partials, that I''d like to control from
the
main template. These partials are templates that look similar in
different contexts, but have different controls depending on where
they''re being rendered. I tried locals, but the result looks ugly - I
basically have to do this:
<% if !defined?(nocontrols) && !nocontrols ->
html to render controls
<% end ->
Then in my main template I call <% render(:partial => "partial",
:locals
=> { :nocontrols => true }) >
This works, but the convoluted if statements make me cringe. Plus, I''d
have to specifically pass these locals to any nested partials, and that
gets too complicated.
Declaring locals in controllers work, but then I can''t include two
partials with different parameters....
There has to be a better way to do this.
--
Posted via http://www.ruby-forum.com/.