I have an OptionsController
, which contains an action account
. The corresponding view has three forms, which post to three different actions, update_profile
, update_user
and change_password
. Each action runs and then should redirect back to action
, where the view is set up again and rendered.
I was trying to be DRY and create an after_filter
to do the redirect:
after_filter( :only => [:change_password, :update_profile, :update_user] ) do |controller|
controller.send(:redirect_to, :action => :account)
end
However, this doesn't seem to get called; rather, the action complains that its view cannot be found.
Template is missing
Missing template options/update_user.erb in view path app/views
Is there any way I can do this in a DRY way, or should I just be sticking the redirect_to call in each of the three actions?