Update: Instead of
@company = Company.find(params[:company_id]
in the Reimbursements New Action
I used @company = Company.find_by_name(params[:company_id]
This replaced the id
in the URL with the name
but still requires /reimbursements/new
at the end of the URL. Any thoughts?
Overview: I have a Companies
controller/model and a Reimbursements
controller/model
A Company has_many reimbursements
A Company
has a name
as well
The Issue:
When a new company is created the link to the new reimbursements
form is
localhost:3000/companies/:id/reimbursements/new
This URL is very long and I would prefer it be:
localhost:3000/companies/company.name
Is this possible? How would I go about doing this? Thanks in advance!