If you meant to use resource :member
(instead of resources :member
) then you should know that it always looks up without referencing an ID
.
Here is how the routes would be created without id's:
edit_dashboard_member GET /dashboard/member/edit(.:format) dashboard/members#edit
dashboard_member GET /dashboard/member(.:format) dashboard/members#show
PATCH /dashboard/member(.:format) dashboard/members#update
PUT /dashboard/member(.:format) dashboard/members#update
When you are sending a PATCH request make sure that you don't pass an argument
with it. If you pass an argument then it would be interpreted as format(like .html, .js etc)
. In your case you passed an argument as 2
or a member with an id 2
For eg:
PATCH request to dashboard_member_path(2)
The route was matched against PATCH /dashboard/member(.:format) dashboard/members#update
2 is interpreted as (.:format)
because there is no :id
part.