def update
@user = User.find(params[:id])
if @user.update_attributes(params[:user])
render :action => show
end
render :template => "fix_user_errors"
end
The previous code will generate an error (because render is called twice) in the case where update_attributes succeeds.
The act of calling render (and redirect_to) should somehow terminate the processing of an action?But its not why?
render doesn’t actually terminate the processing of the action.
You need to add an else to your if statement:
I think you can also use “return render …” which will return immediately from the action method but this might have unintended consequences.