SitePoint Sponsor

User Tag List

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

    Unhappy "Simply Rails 2" Chapter 6 Problem

    Hello,
    I've been working through Lenz's "Simply Rails 2" book successfully up to Chapter 6 p. 171. All steps have worked for me up until there, but then when going on to the next steps to have the flash notice read 'Story submission succeeded', when I check the application in a browser and submit a story, no such message displays; only the same "stories" page as before.

    I'm following the modifications to the files on p. 172-174 exactly and have tried both typing the changes carefully and using the downloaded code. It didn't look like there was any listed errata about this. I've actually even restarted all the steps fresh from the beginning of the book to see if I missed anything and ended up with the same result.

    Please help!!

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,139
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)
    Hi gnovah, welcome to the forums,

    I'm wondering if your URL mapping is at fault. Does your config/routes.rb file look like (pg. 164)
    Code Ruby:
    ActionController::Routing::Routes.draw do |map|
      # The priority is based upon order of creation: first created -> highest priority.
    .........
      # Sample resource route (maps HTTP verbs to controller actions automatically):
      #   map.resources :products
      map.resources :stories
    ......... 
      # See how all your routes lay out with "rake routes"
     
      # Install the default routes as the lowest priority.
      map.connect ':controller/:action/:id'
      map.connect ':controller/:action/:id.:format'
    end

  3. #3
    SitePoint Member
    Join Date
    May 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply! I've pasted my routes.rb file below; seems the same (no comments in it)--I just pasted it in from the downloaded code.
    Code Ruby:
     
    ActionController::Routing::Routes.draw do |map|
      map.resources :stories
      map.connect ':controller/:action/:id'
      map.connect ':controller/:action/:id.:format'
    end

    Thanks,

  4. #4
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,139
    Mentioned
    190 Post(s)
    Tagged
    2 Thread(s)
    That looks OK. Nothing helpful in the log/development.log or log/server.log files?

  5. #5
    SitePoint Member
    Join Date
    May 2009
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Tried it again this morning, and now it works! Without even changing anything.
    Thanks though!


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
  •