Skip to content

Instantly share code, notes, and snippets.

Created February 23, 2016 17:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save anonymous/60b2d7fd1e8dfb89ef3c to your computer and use it in GitHub Desktop.
Save anonymous/60b2d7fd1e8dfb89ef3c to your computer and use it in GitHub Desktop.
Material Design Lite wrappers for Simple Form
# Simple wrappers for Material Design Lite text fields to use with SimpleForm (Rails)
SimpleForm.setup do |config|
config.wrappers :mdl_field, tag: 'div', class: 'mdl-textfield mdl-js-textfield', error_class: 'mdl-textfield__error' do |b|
b.use :html5
b.use :input, class: 'mdl-textfield__input'
b.use :label, class: 'mdl-textfield__label'
end
config.wrappers :mdl_field_floating, tag: 'div', class: 'mdl-textfield mdl-js-textfield mdl-textfield--floating-label', error_class: 'mdl-textfield__error' do |b|
b.use :html5
b.use :input, class: 'mdl-textfield__input'
b.use :label, class: 'mdl-textfield__label'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment