Forum: Ruby on Rails undefined method `stories_path'

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.
Merrick J. (Guest)
on 2008-12-20 06:27

I recieve error "undefined method `stories_path' for
#<ActionView::Base:0x995b4ac>" when going to the view via

The model is setup correctly, I can retrieve data from the db fine. I
think it might be related to the helper but I have no idea where to
start. It seems to think its failing on the first line of the view, i
belive on the 'form_for' method.

heres the traceback:


class StoriesController < ApplicationController
  def index
    @story = Story.find_by_name('SitePoint Forums')
  def new
    @story =


<% form_for @story do |f| %>
  name: <br />
  <%= f.text_field :name  %>
  link: <br />
  <%= f.text_field :link %>
  <%= submit_tag %>
<% end %>
Bryce R. (Guest)
on 2008-12-20 06:31
(Received via mailing list)
Is your config/routes.rb properly set up?

-- Bryce R.
Merrick J. (Guest)
on 2008-12-20 06:36
Bryce R. wrote:
> Is your config/routes.rb properly set up?
> -- Bryce R.

Aha, fixed. Yea thanks for the tip, completely overlooked mapping the
resource. The solution was:

map.resources :stories
Bryce R. (Guest)
on 2008-12-20 07:25
(Received via mailing list)
Glad to help.

I assume you're following the SitePoint Rails book? It's a good one –
it helped me learn Rails when I was starting out (I got the free copy
for Rails 2.1)

-- Bryce R.
This topic is locked and can not be replied to.