On Feb 20, 10:20 pm, James Bond <[email protected]>
wrote:
> Andrew Bloom wrote:
> > def current_li(content, x)
> >   klass = x ? "current" : nil
> >   content_tag(:li, content, :class => klass)
> > end
>
> Thanks, but why this doesn't work?
>
> <%= current_li {link_to "xxx", :controller => "yyy"}, @x == 1 %>

because you're passing a block that generates a link to . something
like
current_li link_to(...), @x == 1

would probably work.

Fred
> --
> 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