- @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", :id => s.id}, :class => "action edit")
= link_to("Delete", {:action => "delete", :id => s.id}, :class => "action delete")
error_msg:
Illegal nesting: content can't be both given on the same line as %td and nested within it.
I want those three links--show, edit, and delete--in the same td; how can I do it?
You just need to change this:
%td= link_to("Show", {:action => "show", :id => s.id}, :class => "action show")
= link_to("Edit", {:action => "edit", :id => s.id}, :class => "action edit")
= link_to("Delete", {:action => "delete", :id => s.id}, :class => "action delete")
to this:
%td
= link_to("Show", {:action => "show", :id => s.id}, :class => "action show")
= link_to("Edit", {:action => "edit", :id => s.id}, :class => "action edit")
= link_to("Delete", {:action => "delete", :id => s.id}, :class => "action delete")
You should also indent the td
s from the tr
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With