I'm not seeing an error, I'd just like to render the errors to the
user, but retain the nested route in the url.
Using render, I lose the nesting in the url and I'm left with "/player/
new"
Does that make sense?
On Dec 10, 8:16 am, "Darren Boyd" <[EMAIL PROTECTED]> wrote:
> What error are you seeing?
>
> When you render an action, it doesn't matter that the controller it belongs
> to might be nested. If you redirect, it does matter that the target might
> be nested (in which case you might "redirect_to [EMAIL PROTECTED], :players,
> :new]".
> But, when you render, you can just call "render :action => 'new'".
>
> Darren
>
> On Wed, Dec 10, 2008 at 7:58 AM, tom hartwell <[EMAIL PROTECTED]>wrote:
>
>
>
> > Hey everyone, I had a question about the render method inside a Rails
> > controller. Looking at the source of the render method (http://
> > api.rubyonrails.org/classes/ActionController/Base.html#M000512) it
> > seems like it does not process a path prefix or nested route. An
> > example that I'm banging my head against follows:
>
> > 1) Player signs up for a league via a nested url "/leagues/1/players/
> > new"
> > 2) There is an error in the information submitted
> > 3) In my controller I would like to retain the errors so a redirect_to
> > cannot be used, but render doesn't seem to do the trick, either.
> > Something like the following (if it were supported) would work:
>
> > render :action => 'new', :prefix => "leagues/#{params[:league_id]}"
>
> > Perhaps I'm missing something and there is a way to do it. Thanks,
> > Tom
>
>
--~--~---------~--~----~------------~-------~--~----~
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
-~----------~----~----~----~------~----~------~--~---