SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Build your own Ruby on Rails web applications - Chapter 7 story_url error

    I'm reading the book and am on chapter 7, implementing permalinks, page 200.

    After I change index.rhtml as stated to:
    Code:
    <%= link_to @story.name, story_url(:permalink => @story.permalink) %>
    I then refresh my http://localhost:3000/story and receive this error:

    Code:
    undefined method `story_url' for #<#<Class:0x336a184>:0x336a15c>

    I've checked to make sure I haven't mispelled anything, any help would be great thanks!

  2. #2
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you defined story_url (in your routes file)?

    Code:
    map.story 'stories/:id', :controller => 'story', :action => 'show'

  3. #3
    SitePoint Member
    Join Date
    Apr 2007
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks mate! Fixed my problem.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •