On May 23, 3:16 pm, Michael Koziarski <[email protected]> wrote: > > Shouldn't form_for be keying off of ":as => :thread" and using > > threads_path/thread_path instead of forum_threads_path/ > > forum_thread_path ? > > No, not as currently designed and implemented. The mapping from > instance to route helper name is done without consulting the routing > definitions at all, it's driven entirely off the class name and a few > simple conventions. This has the downside that you get the errors > that you're seeing now. But there's also the upside that you can have > those helpers call routes defined in ways other than resources. e.g. > manually connecting posts to a URL then using form_for @post.
In digging into this a bit more, I had mistakenly been under the impression that it was the controller that was used to infer this path, but it actually turns out the be the model object. Does it really make sense to let the naming of a model object bleed so far through the application layer without a "no, use this name instead" fallback? -J -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
