small medium large xlarge

Generic-user-small
21 Sep 2012, 10:58
Maro (1 post)

When I type Localhost:3000/product I get:

error message: No route matches [GET] “/” Try running rake routes for more information on available routes.

In routes (depot\config) I uncomment root :to => ‘welcome#index’ I deleted the default page rm public/index.html

What should I change in routes to see product page in my browser?

Generic-user-small
30 Sep 2012, 03:13
Clayton Stone (1 post)

I’m sure you’ve figured it out by now, but do you have an index method defined in your products_controller.rb?

`def index @products = Product.all

respond_to do |format|
  format.html # index.html.erb
  format.json { render json: @products }
end   end`
You must be logged in to comment