Created by: gracewashere
Problem:
When a model overrides #to_param
to have more meaningful URLs,
Administrate was still trying to look the objects up by their id
s
instead of by whatever attribute the param
was representing.
Solution:
- Extract a
find_resource
method in dashboard controllers - Devs can override the method to look up resources using custom logic
Side Effects:
- Add a custom to_param to Product model for testing
See https://trello.com/c/ew5pA2G5
Tags: #ruby