Models:
UserApplication
Relationship:
User has many Application
Normally, I’d use fields_for in User form to add/edit/destroy Application associated to the User. But since the User itself has a lot of fields, I’d like to separate User and Application form. I’m thinking something like this:
GET /user/:user_id/applications will render the form (probably using cocoon gem). It will submit the form to POST /user/:user_id/applications.
Is this OK? Or maybe there’re better ways to do this?
Summary:
-
GET/user/:user_id/applications- renders the form for edit/update/destroyApplicationfor the selectedUser -
POST/user/:user_id/applications- process the form -
GET/user/:user_id- will show theUserandApplicationdata. - There will be no
new,edit,update,destroyactions forApplication.