Skip to content

Instantly share code, notes, and snippets.

@assembler
Created March 30, 2012 09:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save assembler/2250290 to your computer and use it in GitHub Desktop.
Save assembler/2250290 to your computer and use it in GitHub Desktop.
defining default form options in simple_form
module SimpleForm::ActionViewExtensions::FormHelper
def simple_form_for_with_defaults(record, options={}, &block)
# define defaults here
simple_form_for_without_defaults(record, options, &block)
end
alias_method_chain :simple_form_for, :defaults
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment