: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

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 M. [email protected] wrote:

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 R.
www.sorrylies.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs