I’m trying to specify the param name of a resource so instead of just “id” I want “account_id”. I can do this by using the param option.
resources "/accounts", AccountController, param: "account_id"
So far so good but my route is actually for nested resources. My routes looks like this:
resources "/accounts", AccountController, param: "account_id" do
resources "/memberships", MembershipController do
resources "/permissions", PermissionController
end
resources "/employees", EmployeeController
resources "/departments", DepartmentController
end
The problem I’m having is that this works for the route “/accounts/1” (conn param is “account_id”) but doesn’t work for “/accounts/1/departments” because the conn param is now “account_account_id”.
How can I set the param to “account_id” when viewing the nested resource routes too? This is because I have a plug that needs that specific param name.






















