render (and redirect_to) should somehow terminate the processing of an action?
Posted
by piemesons
on Stack Overflow
See other posts from Stack Overflow
or by piemesons
Published on 2010-05-11T06:48:07Z
Indexed on
2010/05/11
6:54 UTC
Read the original article
Hit count: 94
ruby-on-rails
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?
© Stack Overflow or respective owner