<li<% if controller.controller_name == 'users' &&
controller.action_name == 'login' %> class="current"<% end %>>

Probably safe syntax. I usually don't like to print things inside of
operations. Plus, with this, you won't get any unnecessary whitespace.

But, there is no right way. As long as that Ruby interpreter does it's
job and doesn't blow up in your face!


On Jan 3, 2:04 pm, Gi Ga <[email protected]> wrote:
> Is there any better way to do this?
>
> <li <%= ('class="current"') if controller.controller_name == 'users' &&
> controller.action_name == 'login' %>>
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to