small medium large xlarge

10 Jun 2012, 00:15
Bill Maya (2 posts)

I’m new to Ruby and Ruby on Rails. I’m using Ruby 1.9.2 and Rails 3.2.5 on Max OSX Lion.

Followed all instructions up to page 65 to create depot app (“rails new depot”), generating scaffolding (“rails generate scaffold Product …”) and applying migration (“rake db:migrate”). When I run the server (“rails server”) and point Safari at http://localhost:3000/products I get the following Action Controller: Exception Caught error message instead of Listing Products page:

Routing Error No route matches [GET] “/products” Try running rake routes for more information on available routes.

rake routes in Terminal gives me:

products GET /products(.:format) products#index POST /products(.:format) products#create new_product GET /products/new(.:format) products#new edit_product GET /products/:id/edit(.:format) products#edit product GET /products/:id(.:format) products#show PUT /products/:id(.:format) products#update DELETE /products/:id(.:format) products#destroy

There is a resources: products line in my routes.rb files. Also, my products_controller.rb has an index method (“def index”).

Any help appreciated. Thanks in advance.

10 Jun 2012, 00:38
Bill Maya (2 posts)

Figured it out - I had another instance of the WEBrick server running in another terminal window but for the “demo” application.

You must be logged in to comment