Re: [Rails] Conditional respond_to doesn't do redirect

2013-04-16 Thread tamouse mailing lists
On Tue, Apr 16, 2013 at 7:15 PM, Wins Lin wrote: > I have such a code in my "create" method: > > respond_to do |format| > if user.save() > format.html {redirect_to(:action => "show")} > else > format.js > end > end > > So if save() is successful I want full redirect to a different pa

[Rails] Conditional respond_to doesn't do redirect

2013-04-16 Thread Wins Lin
I have such a code in my "create" method: respond_to do |format| if user.save() format.html {redirect_to(:action => "show")} else format.js end end So if save() is successful I want full redirect to a different page. If not successful then no redirect, just show user an ajax message