Joshua Muheim
2006-Sep-30 20:44 UTC
:redirect_to => :back only when HTTP[REFERER] available?
Hi there I have the following verifying code: verify :params => :some_key :only => [:new, :create], :add_flash => {:notice => ''Hinzufügen ist deaktiviert.''}, :redirect_to => :back Is there a way only to redirect to :back when the corresponding header is available? Greets, Josh -- 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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Ross Riley
2006-Sep-30 20:51 UTC
Re: :redirect_to => :back only when HTTP[REFERER] available?
I''ve always solved it by intercepting the RedirectBackError and then either send the user to an error page if they shouldn''t have accessed the link directly or to the home page if there''s a chance they could access directly. You do this by overriding the rescue_action_in_public method. Ross On 9/30/06, Joshua Muheim <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi there > > I have the following verifying code: > > verify :params => :some_key > :only => [:new, :create], > :add_flash => {:notice => ''Hinzufügen ist deaktiviert.''}, > :redirect_to => :back > > Is there a way only to redirect to :back when the corresponding header > is available? > > Greets, > Josh > > -- > Posted via http://www.ruby-forum.com/. > > > >-- Ross Riley www.sorrylies.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-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---