I have an admin namespace and a scaffold of companies hosted from the admin namespace. I wanted to put companies in the admin namespace. Then I put companyscontroller in the admin directory and changed the definition to class Admin::CompaniesController < Admin::AdminController and put the company views in the admin directory in / app / views / and put company_helper in the admin directory, and now it looks like this:
module Admin :: CompaniesHelper
end
Namespace in routes.rb:
namespace: admin do
root: to => "companies # index"
resources: companies
end
When I switch to localhost: 3000 / admin, I get this error:
undefined method `company_path 'for #: 0xb696b408>
Now please tell me how to edit links so that the links work correctly?
Nozim source share