route.rb:
map.resource :car_users
car_users_controller.rb:
class CarUsersController < ApplicationController
def index
@car_users = CarUsers.all
end
def show
end
end
I created a link in a view:
link_to "SOMELINK", car_users_path
I thought the car_users_path will invoke the index method of the controller and render the index.html.erb, but it goes to the show.html.erb and invoke the show method in the controller. Why not index?
(I am working with Rails v2.3.2)
I think you’re just missing an
sshould be