Sorry, I posted this on Questions, then realized I should have posted it here. I started this forum today.

I am new to Rails.
When I browse to localhost:3000/stories, —it works.
When I browse to localhost:3000/stories/2
I get a NoMethodError showing stories/show.html.erb that says "You have a nil object when you didn't expect it! The error occured while evaluating nil.name"

The Extracted Source is
1: <h2><%= @story.name %></h2>
2: <p><%= link_to @story.link, @story.link %></p>

(which is from show.html.erb)

stories_controller.rb shows
class StoriesController < ApplicationController

def index
@story = Story.find(:first, :order => 'RANDOM()')
end

def new
@story = Story.new
end

def create
@story = Story.new(params[:story])
if @story.save
flash[:notice] = "Story submission succeeded"
redirect_to stories_path
else
render :action => 'new'
end

def show
@story = Story.find(params[:id])
end
end
end

Can anyone help?

Thanks