views:

65

answers:

1

I have the Shovell source code from the book Simply Rails 2, but I'm having problems running it.

"Getting started
Here’s how to get rolling:

   1.
      Create your databases and edit config/database.yml

      Rails needs to know your login and password.
   2.
      Use script/generate to create your models and controllers

      To see all available options, run it without parameters.
   3.
      Set up a default route and remove or rename this file

      Routes are set up in config/routes.rb."

I took step 1, then since the models and controllers are already generated for a source code that already exists, I skipped step 2 and since a default route is already set for a source code that already exists, I skipped step 3.

My config/roubes.rb has map.root :controller => "stories", but http://localhost:3000/ still doesn't load the stories controller index. Why?

By the way, routes.rb says:

map.resources :users
map.root :controller => "stories"
map.resource :session
map.resources :stories, :has_many => :votes, :collection => { :bin => :get }
map.connect ':controller/:action/:id'
map.connect ':controller/:action/:id.:format'
+3  A: 

I'm not sure how old your source is or what gem/vendor'd version of rails you are running off of, but based on your pastie, it seems like your project is in an 'older style'. You can try rake rails:update which should help fix some of your issues.

To be clear, from what I remember, you need to rename your application controller from application.rb to application_controller.rb. Hope this helps.

Cheers.

theIV
After deleting public/index.html, I renamed application.rb to application_controller.rb, then used rake to migrate my data with rake db:migrated and it worked!
Delirium tremens