Skip to content

Instantly share code, notes, and snippets.

@nicolasblanco
Created June 11, 2015 08:46
Show Gist options
  • Select an option

  • Save nicolasblanco/32120d61c02afc69a48c to your computer and use it in GitHub Desktop.

Select an option

Save nicolasblanco/32120d61c02afc69a48c to your computer and use it in GitHub Desktop.
class DatePickerInput < SimpleForm::Inputs::Base
def input
res = "<div class='col-sm-6'>"
res << @builder.text_field(attribute_name, input_html_options.merge(name: nil, class: "form-control datepicker"))
res << @builder.hidden_field(attribute_name, id: "#{attribute_name}_hidden")
res << "</div>"
res.html_safe
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment