Try something like this: def current_li(content, x) klass = x ? "current" : nil content_tag(:li, content, :class => klass) end
On Feb 20, 3:55 pm, James Bond <[email protected]> wrote: > How make a helper: > > If value X is true: print <li class="current"> else <li> > -- > 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 -~----------~----~----~----~------~----~------~--~---

