After thinking about it some, I guess I could just do this: - if @my_account %li.active= link_to "My Account", account_path(@my_account) - else %li= link_to "My Account", account_path
Anyone have a better solution? On Nov 21, 11:13 am, deadwards <[EMAIL PROTECTED]> wrote: > I am relatively new to Haml, and have a question. Is it possible to > include rails code inside of an html tag? > > Here is the erb code that I'm trying to convert to Haml: > <code><pre> > <li<%= " class='active'" if @my_account %>><%= link_to "My Account", > account_path(@my_account) %></span></li> > </pre></code> > > Thanks for any help. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Haml" 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/haml?hl=en -~----------~----~----~----~------~----~------~--~---
