Can you use polymorphic urls with form_for when you have a singular
resource?
In routes.rb
map.resource :blog
In BlogsController
def new
@blog = Blog.new
end
In new.html.erb
<% form_for @blog do |f| %>
....
<% end %>
But the view is giving me the following error.
undefined method `blogs_path'' for #<ActionView::Base:0xb691281c>
I do not know why @blog is converting into blogs_path. Shouldn''t it be
converted to create_blog_path since @blog is a new record? If it was an
existing record I would assume it would go to update_blog_path or
something.
Can someone please explain what I am doing wrong.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---