Leonel *.* wrote in post #965703:
> So instead of
> ----------------------------------------
>    respond_to do |format|
>       if @user.update_attributes(params[:user])
>         flash[:notice] = 'User was successfully updated.'
>         format.html { redirect_to(:action => 'edit') }
>       else
>         flash[:error] = 'User was not updated.'
>         format.html { render :action => "edit" }
>       end
>     end
> ----------------------------------------
> Should I do this?
> ----------------------------------------
>       if @user.update_attributes(params[:user])
>         flash[:notice] = 'User was successfully updated.'
>         format.html { redirect_to(:action => 'edit') }
>       else
>         flash[:error] = 'User was not updated.'
>         format.html { render :action => "edit" }
>       end
> ----------------------------------------

If you did that, where would the local variable "format" be defined?

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to