how can I stop further processing of my script after I call redirect_to ? I''ve tried using the ''return'' keyword immediately after redirect_to but any code after redirect_to still get''s executed. help!
anyone knows? 2005/4/13, Alan Bullock <liststuff-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> how can I stop further processing of my script after I call redirect_to ? > > I''ve tried using the ''return'' keyword immediately after redirect_to > but any code after redirect_to still get''s executed. help! > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Hi, Alan Bullock <liststuff-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> how can I stop further processing of my script after I call redirect_to ? > > I''ve tried using the ''return'' keyword immediately after redirect_to > but any code after redirect_to still get''s executed. help!if you call redirect_to in any filter method, you need to return false, maybe. Regards, ---- Kazuhiro Yoshida moriq-g2rar0VqK2oAvxtiuMwx3w@public.gmane.org
On 4/13/05, Alan Bullock <liststuff-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> how can I stop further processing of my script after I call redirect_to ? > > I''ve tried using the ''return'' keyword immediately after redirect_to > but any code after redirect_to still get''s executed. help!Seems strange to me. Think ''return'' will be enough. Small code fragment from hieraki sources (i''m not the hieraki author) follows: ------------------- >8 ---------------- begin @author.save rescue SocketError redirect_to(:controller => ''error'', :action => ''email_approval_error'', :id => @params[''id'']) return end ------------------- >8 ----------------
Stefan Kaes wrote:>> ------------------- >8 ---------------- >> begin >> @author.save >> rescue SocketError >> redirect_to(:controller => ''error'', :action => >> ''email_approval_error'', :id => @params[''id'']) >> return >> end >> ------------------- >8 ---------------- >> >> > The return is superfluous.No, there is other code following it. Remember, it''s just a snippet of the actual method :) Kind regards, Dennis Oelkers
Stoyan Zhekov wrote:>On 4/13/05, Alan Bullock <liststuff-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >>how can I stop further processing of my script after I call redirect_to ? >> >>I''ve tried using the ''return'' keyword immediately after redirect_to >>but any code after redirect_to still get''s executed. help! >> >> > >Seems strange to me. Think ''return'' will be enough. Small code >fragment from hieraki sources (i''m not the hieraki author) follows: > >------------------- >8 ---------------- >begin > @author.save >rescue SocketError > redirect_to(:controller => ''error'', :action => >''email_approval_error'', :id => @params[''id'']) > return >end >------------------- >8 ---------------- > >The return is superfluous.
I''ve seen this used before: redirect_to ''bob'' and return> how can I stop further processing of my script after I call redirect_to ? > > I''ve tried using the ''return'' keyword immediately after redirect_to > but any code after redirect_to still get''s executed. help! > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails