Re: [Rails] Re: Redirect to edit form after update

2010-12-03 Thread Edmond Kachale
2010/12/2 Leonel *.* li...@ruby-forum.com 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') }

[Rails] Re: Redirect to edit form after update

2010-12-03 Thread Leonel *.*
Thanks a lot guys. Yes, I'll try to understand Ruby syntax more. I studied the PDF of the unfinished version of the new Agile Web Development with Rails. After that, I bought the pickaxe Programming Ruby 1.9 book and I'm barely getting into it. Thanks -- Posted via

[Rails] Re: Redirect to edit form after update

2010-12-02 Thread Leonel *.*
Thanks :) I just removed the XML part and yes I did notice I had the flash in the wrong position haha. What do you mean by I am not sure if you really want to conditional processing of HTTP? I'm sorry if the question seems very basic, I'm barely getting familiar with Ruby. -- Posted via

[Rails] Re: Redirect to edit form after update

2010-12-02 Thread Leonel *.*
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

[Rails] Re: Redirect to edit form after update

2010-12-02 Thread Marnen Laibow-Koser
Leonel *.* wrote in post #965703: [...] I had the respond_to block because that's how it was programmed by the scaffold and wasn't sure if I should remove it or not. Yet another reason not to use scaffolding: it generates a lot of junk that you won't understand if you're a beginner and you

[Rails] Re: Redirect to edit form after update

2010-12-02 Thread Marnen Laibow-Koser
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

[Rails] Re: Redirect to edit form after update

2010-12-02 Thread Leonel *.*
Marnen Laibow-Koser wrote in post #965706: 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 {

[Rails] Re: Redirect to edit form after update

2010-12-02 Thread Marnen Laibow-Koser
Leonel *.* wrote in post #965713: Marnen Laibow-Koser wrote in post #965706: Leonel *.* wrote in post #965703: So instead of respond_to do |format| if @user.update_attributes(params[:user]) flash[:notice] = 'User was successfully

[Rails] Re: Redirect to edit form after update

2010-12-01 Thread Leonel *.*
ALRIGHT!! AWESOME!!! Simple and it works! I did this... flash[:notice] = 'User was successfully updated.' respond_to do |format| if @user.update_attributes(params[:user]) format.html { redirect_to(:action = 'edit') } format.xml { head :ok } else ... Thanks Colin! -- Posted via

[Rails] Re: Redirect to edit form after update

2010-12-01 Thread Tim Shaffer
On Dec 1, 11:12 am, Leonel *.* li...@ruby-forum.com wrote: ALRIGHT!! AWESOME!!! Simple and it works! I did this... flash[:notice] = 'User was successfully updated.' respond_to do |format|   if @user.update_attributes(params[:user])     format.html { redirect_to(:action = 'edit') }    

Re: [Rails] Re: Redirect to edit form after update

2010-12-01 Thread Edmond Kachale
Le 1 décembre 2010 18:12:01 UTC+2, Leonel *.* li...@ruby-forum.com a écrit : ALRIGHT!! AWESOME!!! Simple and it works! I did this... flash[:notice] = 'User was successfully updated.' respond_to do |format| if @user.update_attributes(params[:user]) format.html { redirect_to(:action