I’m working on an application (on Edge Rails) that has a really long
profile page - viewed, of course, with a GET to /users/:id.
The editing side of things needs to be broken up into four
logically-grouped screens - say, contact info, work history, education,
personal info. These screens are essentially update-only - their “show”
counterpart is the whole profile at /users/:id. And the update can only
performed by current_user, so the :id is superfluous.
There is no Create function, and there is no Delete function.
So far, I see only two choices:
Don’t use RESTful routes at all. Change the GET to /users/show/:id,
do the updates with POSTs to /users/edit_contact_info,
/users/edit_education, etc. Put it all in users_controller. This is
path I’ve been taking, but it loses some of the simply_helpful magic.
Create RESTful routes, and manually draw them in routes.rb. This
brittle, and I have to lie about (e.g.) “contact_info” belonging to the
collection instead of the member, since I don’t want the :id in the URL.
Plus, I think that means each of the four mini-edit pages has to go in
own, one-action controller! Ugly.
Is there a third way?