I have a route like this:

  map.resources :blog, :controller => 'posts'

This seems to confuse form_for's model introspection when using this
syntax:

  form_for @post do |f| ... end

When I go to a page that has that code, I get a NoMethodError:

  undefined method `posts_path' for #<ActionView::Base:0x103dd2030>

I've discovered I can fix it by doing:

  form_for @post, :url => { :action = 'whatever-action-it-should-have-
been' } do |f| ... end

Do I need to manually set the :url parameter like this every time I
use form_for or is there a way to get it to globally recognize my
altered named routes?

Thanks in advance!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to