ruby on rails - Assign value using loop in HAML -


my question kind of general ruby question, i'm using haml i'll ask in context.

i'm using twitter bootstrap , want iterate on list populate popover's content

i have:

    %div        =link_to link_name, link, ..., "data-content" => <my_content_here> 

and want put following data content. i've tried partials, can't seem work

    %div       f.item.each |t|         .myclass=t 

haml

%div  - f.item.each |t|     = link_to link_name, link, ..., data: {content: your_content}, class: t 

you'll benefit reading on haml docs

you need indent each code bock; div being block & . each loop being block

the main thing need remember = equal <%= | - equal <%


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -