Conditional action - if action = '' do this


trying to work this out to build a dynamic sidebar,

i’ve got the sidebar in a partial, now wondering how to get different
elements to hide for certain actions…


<% if action = ‘about’ %>
about logo
<% end %>

any ideas how you can run conditional parts based on the action you just
did, or should i set & call a variable instead?

appreciate it,



sweet enough?

Hi –

On Wed, 8 Aug 2007, Shai R. wrote:


sweet enough?

Make sure to use == and not = though…



<% if params[:action] == ‘about’ %>
<% end %>

you rock!

thanks, it suddenly struck me that i could this this another way.

you see i’ve got the main layout in…


so by putting in a code to pull in a partial i could not specify the
controller to pull it from and then it would pull that partial from the
controller / view the actions sitting in then and there.

as long as i have the same named partial in each view, pretty sweet.

however thanks for the params[:action] should work out right, yep got
the == meaning check if identical.

thanks guys,