Thanks for the reply, Michael.

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.

That's what I was afraid of.

I certainly enjoy the simplicity of form_for @post, but it would also
be very useful for :as => :thread to influence the routing that's
generated (or to have some option that influences the generated
routing).  The downside would appear to be that if you have a
controller whose name doesn't perfectly match to a named route that
you're stuck having to implement a separate form for the new and edit
cases, which is a non-DRY bummer.

-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.

Reply via email to