When I:
self.save
or
save!
in a model it automatically redirects me to the show view for that given model. How can I override this? I want to save the model and then go to another action/view in the same controller.
In particular, I have a process where I save a members details, and then I want to continue the process by going to the next page, e.g. payment page, that uses the id of the saved model.
In your controller you might have a block like:
You can change the target of the redirect_to (after format.html) from here – at present it is directing you to the record for that user, ie. @user. Take a look at http://api.rubyonrails.org/classes/ActionController/Base.html for a bit more info.