Forum: Ruby on Rails form_for problem with singular resource

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Joe B. (Guest)
on 2008-11-16 00:32
Can you use polymorphic urls with form_for when you have a singular

In routes.rb
  map.resource :blog

In BlogsController
  def new
     @blog =

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

Can someone please explain what I am doing wrong.
This topic is locked and can not be replied to.