mercredi 23 août 2017

How to add nested links to Haml mockup

Trying to build app on Ruby on Rails - faced with haml. Couldn't understand how to build nested each loops - always catch different errors. here example of the code:%table

  %tr
    %th Title
    %th Text
  - @articles.each do |article|
    %tr
      %td article.title
      %td article.text
      %td
        - article.tags.each do |tag|
        = link_to(tag.tag_name)

error: syntax error, unexpected keyword_ensure, expecting keyword_end and after it end-of-input, expecting keyword_end

if I delete haml tags everything works. Can't understan what I'm doing wrong..




Aucun commentaire:

Enregistrer un commentaire