mardi 30 septembre 2014

How to add new object of model in a foreign controller


Vote count:

0




I am rather new to Rails.


I am working on a profile-page for a User. The show view is divided into partials. The thing about my modelling structure is, that a User can have a Skill. But the User model itself does not have a Skill related column, so all Skill entries are saved in the Skill model.


So, my question is, how can I include a partial into the User show view, that contains a simple add Skill form (name needed only), which saves that Skill into its own table and adds it to the others collection of User.skills?



asked 1 min ago







How to add new object of model in a foreign controller

Aucun commentaire:

Enregistrer un commentaire