- @subjects.each do |s| %tr %td= s.position %td= s.name %td= s.visible ? "Yes" : "No" %td= s.pages.size %td= link_to("Show",{:action => "show",:id => s.id},:class => "action show") = link_to("Edit",{:action => "edit",:class => "action edit") = link_to("Delete",{:action => "delete",:class => "action delete")
ERROR_MSG:
Illegal nesting: content can’t be both given on the same line as %td and nested within it.
解决方法
你只需要改变这个:
%td= link_to("Show",:class => "action show") = link_to("Edit",:class => "action edit") = link_to("Delete",:class => "action delete")
对此:
%td = link_to("Show",:class => "action delete")
你还应该从tr缩进tds.