How do I make this link tag in HAML?

Meltemi picture Meltemi · Apr 30, 2011 · Viewed 43.8k times · Source

How can I do something like this in HAML (within Rails app such that it matters)?

<li><a href="#" title="Meet the Team"><strong>Team <em>16 members</em></strong></a></li>

Edit: how also to do it with link_to and a route of pages_team?

Answer

radixhound picture radixhound · Apr 30, 2011

The basic method would look like this ...

%li
  %a{ :href => "#", :title => "Meet the Team" }
    %strong
      Team
      %em 16 members

Or using the new hash syntax ...

%li
  %a{ href: "#", title: "Meet the Team" }
    %strong
      Team
      %em 16 members