SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Chapter 6: Can't Store Votes

    After modifying the RJS template and noticing that the votes on each story were not being updated via Ajax, I refreshed the page itself and realized that votes were not being updated at all. In fact, Im pretty sure no votes are being stored after I click the 'shove it' button.

    If I call the size method for a particular story's associated votes in the console, nothing new appears, even after clicking the 'shove it' button.

    Everything looks good in the browser. My show.html.erb file is updated, as well as my votes_controller.rb file - so a vote should be stored.

    Here's what the terminal reads after clicking the 'shove it' button:
    ________

    Processing StoriesController#5-simply-rails-2-forum (for 127.0.0.1 at 2009-07-06 11:24:30) [POST]
    Parameters: {"commit"=>"shove it", "authenticity_token"=>"Y+KPTESPE1wwzu/zwuV1LIb/ilnuBloMOLgpWius+iI=", "id"=>"votes"}

    ActionController::UnknownAction (No action responded to 5-simply-rails-2-forum. Actions: create, index, new, and show):

    Rendering rescues/layout (not_found)
    _________

    Can anyone please help?

    Thanks!

  2. #2
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    FIgured it out. I did not correctly modify the config/routes.rb file. I, at first, added the the entire block of code in the book to the existing code in the file. I should have only modified the [map.resources :stories' line.


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
  •