css - Apply conditional class in a rails view inside map{} using haml -


i trying apply class conditionally names associated reminder. if there 3 persons associated reminder - jay, jonah , jamison... , jonah 1 acknowledged reminder, want name have class "acknowledge", though want display 3 names.

%tbody   -reminder.each |r|     %tr       %td          =r.persons.each.map{|n| n.name{:class=> ("acknowledge" if r.completed_by.id == n.id)} }.join(',') 

i tried apply class inside map{} shown above error saying

syntax error, unexpected =>, expecting '}'

any appreciated.

%tbody   - reminder.each |r|     %tr       %td          - r.persons.each |person|           %span{class: "acknowledge" if person.completed_by.id == n.id}= person.name 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -