Remove the following lines from routes.rb
# config/routes.rb
# get "companies/index"
# get "companies/new"
# get "companies/show"
# get "companies/create"
# get "companies/edit"
Notice that RESTful controller actions like edit
and show
require a specific Company
passed in order for the correct company to be looked up. These get
routes don't allow for that. Instead, you should be utilizing the resource routes you've already
created:
# config/routes.rb
resources :companies
The non-resourceful routes are impeding the execution of the resourceful ones. Removing them should fix your problem.