I'm bumping this and asking for someone (anyone really) to give me
some feedback on whether this would be acceptable syntax for allowing
for fallback with redirect_to :back.
     redirect_to :back, :controller => 'alternative_controller',
:action =>'alt_action'
     redirect_to :back, 'http://alternative.url.test.host/blah'

If this is something that shouldn't be in the core at all, someone
atleast respond and tell me so. Regardless, I think the first half of
the patch (throwing a helpful exception is there is no request.env and
redirect_to :back is called) should be included.

I've added my latest diff to the ticket
[http://dev.rubyonrails.org/ticket/3049] and included docs.

Kev


On 12/4/05, Kevin Clark <[EMAIL PROTECTED]> wrote:
> Hi guys,
> I'm working on additions to what I submitted in ticket #3049
> [http://dev.rubyonrails.org/ticket/3049]. Someone suggested that
> redirect_to :back should allow for an alternate redirect if no referer
> is set.
>
> I've looked at the code for a while and allowing for:
>      redirect_to :back, :alternate => { OPTIONS HERE }
> and such seems like it will produce fairly messy code in def redirect_to.
>
> I do have a working implementation where you just place the alternate
> redirect after the :back:
>      redirect_to :back, :action => 'alternative_action'
>
> Does this seem acceptable? Is the :alternate syntax needed? Can
> someone think of a clean way to allow for the :alternate syntax given
> redirect_to's prototype:
>      redirect_to(options = {}, *parameters_for_method_reference))
>
> Kev
>
_______________________________________________
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core

Reply via email to