I can change the name of the :id parameter in routing with in this way but this can change the nested resource's parameter like if I have
resources :companies, param: :company_id do
resources :shares, only[:index]
end
this will generate route like
/companies/:company_company_id/shares
which is wrong I want route like this
/companies/:company_id/shares
What I need to do?
I've experienced this before and got the below to fix this... it's ugly though, but I haven't found a better way.
Change:
To: (notice the blank
only: []
)Now when you run
rake routes
you'll see the correct:in addition to all the other
companies
endpoints:All keeping the same
:company_id
param name.