Skip to content

Instantly share code, notes, and snippets.

@amiel
Created April 5, 2013 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amiel/5320486 to your computer and use it in GitHub Desktop.
Save amiel/5320486 to your computer and use it in GitHub Desktop.
Hack to undecorate resource for forms. Regarding https://github.com/gregbell/active_admin/issues/2013
module ActiveAdmin
module ViewHelpers
module FormHelper
def active_admin_form_for(resource, options = {}, &block)
options = Marshal.load( Marshal.dump(options) )
options[:builder] ||= ActiveAdmin::FormBuilder
+ resource = resource.respond_to?(:model) ? resource.model : resource
semantic_form_for resource, options, &block
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment