gregbell/active_admin — pull request #2085 by amiel (2013-04-10 01:12:57+00:00)
Title: Add option to "undecorate" resource for forms

This pull-request adds the following options:

```ruby
ActiveAdmin.register MyModel do
decorate_with MyModelDecorator

# Calls `model` on resource before calling semantic_form_for
form undecorate: true do
# ...
end

# or pass the method to call on the resource
form undecorate_with: :model do
# ...
end
end
```

This make me wonder. It seems like we should either:

1. have an `undecorate` option, that is just hard-coded to use `model`. `model` is the draper default. Although `ActiveAdmin` does not require Draper, it does expect a Draper-like api, so this seems reasonable.
2. or have a more generic call-this-method-on-my-resource-before-passing-it-to-semantic-form-for option like `undecorate_with` but with a more generic name.

(btw, I'm not attached to the option name `undecorate`, if you have a better solution).

Thoughts?

This also adds more coverage for `ActiveAdmin::ViewHelpers::FormHelper.active_admin_form_for` (specs not specific to this pull-request).

See discussion at #2057.