Topic: [RESOLVED] Nested Routes and the render() Method... Is there a Way?
I am trying to use the render() method to re-render a form if the form fails to save. The form, cars/new.html.erb, is being accessed via the route /user/:user_id/cars/new. The create action for the Cars controller attempts to save both the Car and the UserCar object (which represents a user's car and JOINs a User with a Car) within a transaction. If either fails validation, then I want to re-render cars/new.html.erb, to display the validation errors so that the user can correct the mistakes.
I am currently using render :action => :new, but that routes the browser to /cars/new. I want it to route to the nested route, /users/:user_id/cars/new. Is this possible with the render() method?
Thanks for the help in advance.
Last edited by johnnyicon (2008-12-13 18:56:25)