SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Threaded View

  1. #1
    SitePoint Zealot daveporter's Avatar
    Join Date
    Mar 2002
    Location
    Perth, Western Australia
    Posts
    133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Page 192 v.story not working

    Hi everyone,

    Working through the book - so far so good up until this annoyance...

    On page 192 in the console where you type:

    v = Vote.find(:first) followed by
    v.story

    I get this error on v.story ( below )

    All that has happened so far in Chapter 7 is creating the vote table ( done and OK ) and added 'has_many :votes' in story.rb &
    'belongs_to :story' in vote.rb, so not much to go wrong !!!!

    Any thoughts welcome !
    Dave

    >> v.story
    NoMethodError: undefined method `story' for #<Vote:0x47a6b0c>
    from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1860:in `method_miss
    ing'
    from (irb):17
    >> belongs_to :story
    NoMethodError: undefined method `belongs_to' for #<Object:0x294f9ec>
    from (irb):18
    Last edited by mattymcg; May 1, 2007 at 20:48.


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
  •