On my App I have created two models Tutorial and Tutorial category and for tutorial i have created a string field for category ( in migration ) 'tutorialcategory'.
On tutorial add page I have added a selectbox field to select category and it is saving properly ( I hope ) as I can see the value after saving the tutorial in show page. but when I see full list using json render i can not see the value there.
Note : both models are separate and none of these contains reference field in migration
model code as follows
class Tutorialcategory < ActiveRecord::Base
attr_accessible :title
def to_param
"#{id}-#{title}"
end
end
class Tutorial < ActiveRecord::Base
attr_accessible :body, :projectcategory, :rating, :title, :tutorialcategory, :videoid
end
Aucun commentaire:
Enregistrer un commentaire