Just a quickie before the answer , As per Rails
convention controller names must be plural please ref :Singular or plural controller and helper names in Rails
Assuming that the controller name is homes_controller.rb
in routes.rb
add a route says resources :homes
, if you do a scaffold routes will be added by the generators
Step 1: Please look out for the available routes by rake routes
, you might get up like
Prefix Verb URI Pattern Controller#Action
homes GET /homes(.:format) homes#index
POST /homes(.:format) homes#create
new_home GET /homes/new(.:format) homes#new
edit_home GET /homes/:id /edit(.:format) homes#edit
home GET /homes/:id(.:format) homes#show
PATCH /homes/:id(.:format) homes#update
PUT /homes/:id(.:format) homes#update
DELETE /homes/:id(.:format)
You can find the controller and its mapped action.
Step 2: You can directly access index
action, http://localhost:3000/homes ('/index') is default
ref: homes GET /homes(.:format) homes#index
Step 3: (if above doenst work) You can backtrace the error from the live termination on the browser if the problem persist when using Rails4