これは私のindex_controller
def index
@category = Category.all
end
私のカテゴリモデルには
has_many :sub_categories
私のsub_categoryモデルには含まれています
belongs_to :category
そして、これが私の見解です
<% category.sub_categories.each do |f| %>
<li>f.name</li>
<% end %>
Rails 4を使用していますが、エラーが発生しています
undefined local variable or method `category' for #<#<Class:0xab758cc>:0xb56c46d8>