title: Apply conditional class in a rails view inside map{} using haml
body: <p>I am trying to apply a class conditionally to the names associated with a reminder. If there are three persons associated with a reminder - Jay, Jonah and Jamison... and Jonah is the one who acknowledged the reminder, then I want his name to have the class "acknowledge", though I want to display all three names.</p>
  
  <pre><code>%tbody
    -reminder.each do |r|
      %tr
        %td 
          =r.persons.each.map{|n| n.name{:class=&gt; ("acknowledge" if r.completed_by.id == n.id)} }.join(',')
  </code></pre>
  
  <p>I tried to apply the class inside the map{} as shown above but get an error saying</p>
  
  <p><code>syntax error, unexpected =&gt;, expecting '}'</code></p>
  
  <p>Any help is much appreciated.  </p>