Skip to content

Datepicker in form partial

akichatov edited this page Jan 27, 2012 · 3 revisions

If, for some reason or another, you had to use a form partial, and you want to add a datepicker, you have to go about it a little differently, as :as => :datepicker won't work. Instead, do this (HAML style):


= semantic_form_for [:admin, @user] do |f|
  = f.inputs "General" do
    = f.input :birth_date, :as => :string, :input_html => {:class => "datepicker"}