Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Nested Routing in Rails 3.0 results in "route set not finalized" error

#6095

Created a new project and in it two models: conferences and events. I then nested events below conferences in my routes.rb file and in testing it all seemed to work until I tried creating any new events or editing existing events below conferences and would repeatedly get "route not found" errors for the POST request. None of the member functions for update or create were even being reached.

Since |resources| takes care of the generation of all those paths, this made no sense. Afterward I used 'rake routes' to determine all the known routes of which |update| and |create| did appear correctly.

I went further and entered the 'rails console' and assigned the router to a variable to interrogate the known paths. Printing the known routes was successful however any use of |recognize_path| or |generate| on the Routing object resulted in a "route set not finalized" error.

There's something in the bowels of the routing system that is not working properly but is working well enough until you need to do create/update operations or introspect the object.

Gists:
Routes.rb : https://gist.github.com/bf397c20f129c248887c
Rails Console Session : https://gist.github.com/722548

Reported by Karl Adam · December 1st, 2010 @ 12:38 AM

State: invalid
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Karl Adam
    Karl Adam

    Thanks to some excellent help in the #rubyOnRails channel on freenode, it was pointed out to me that this was in fact user error. The original problem was in my form partial not passing both objects as an array to form_for and the 'route set not finalized' error was due to not first calling finalize on the Router.

    December 1st, 2010 @ 12:52 AM

  2. Aditya Sanghi
    Aditya Sanghi
    • State changed from new to invalid
    • Importance changed from to Low

    Closing.

    December 1st, 2010 @ 07:52 AM