I have a model Tutorial
and has_many association Tutorialcategory
where tutorials can be connected to many tutorial categories. Tutorials model and controller are working fine but categories are not. I am able to add categories but can not edit them, I am getting 'undefined method `model_name' for NilClass:Class' error while accessing edit page for tutorialcategory.
I have defined route as follows
resources :tutorialcategories do
end
following is my model definition
class Tutorial < ActiveRecord::Base
has_many :tutorialcategories
Aucun commentaire:
Enregistrer un commentaire