Reputation: 46
I'm working on a site where the sign-up process is multi-step.. so many little forms all update the user model (i'm using the devise gem for user authentication).
Should I post each of these steps to the same update action (overriding the RegistrationController update action)? Each form may require some logic before the update occurs, therefore the forms will require some way of figuring out what form it's currently processing (either a hidden field or trying to establish from what params exist)
..or should I be posting the forms to individual actions (which isn't very RESTful)?
Thanks!
Upvotes: 0
Views: 302
Reputation: 107728
I would not override the RegistrationsController
to add an update action. I would have a completely separate UsersController
that defines an update
action that takes the parameters for updating a user.
Inside Spree (the thing I work on) we've got an update
action on CheckoutController
that works similar to how you want your users update action to work. Check it out.
Upvotes: 2