gregbell/active_admin — pull request #2315 by amiel (2013-07-02 18:36:48+00:00)
Title: ActiveAdmin::Resource loads a resource for breadcrumbs

Here is an proof-of-concept attempt at gregbell/active_admin#2266.

A couple of notes/thoughts:

* I think this is better than having the loading logic in the breadcrumbs helper, but it still doesn't seem idea. All of the resource loading logic is already in the controller (through inherited resources, so not easy to refactor out).
* Another possible direction would be to use `ActiveAdmin::Resource#controller` to load the resource. I started trying this, but it gets ugly pretty quick. Here's what it would look like:

```ruby
def resource_from_param(id)
c = controller.new
c.params = { id: id }
c.send(:instance_variable_set, "@_session", session)
# I didn't actually get this far, so I'm not sure what other hacks we would need...
c.send(:resource)
end
```

So, yeah, not great, but at least the resource loading logic isn't duplicated.

@Daxter, any thoughts?