0

This is my image when I want show name category with association relationship:

http://i.stack.imgur.com/nxvIJ.png

This is the code:

column :categories do |c|
  table_for c.categories.all do
    column do |category|
      link_to category.name, [ :admin, category ]
    end
  end
end

I don't want to use table_for, because it has "table" which I don't want.

How do I do this?

4

1 回答 1

1

您可以简单地列出它们:

index do
  column :categories do |c|
    ul do
      c.categories.each do |category|
        li link_to(category.name, [:admin, category])
      end
    end
  end
end
于 2013-10-12T02:54:28.983 回答