title: Rails 4 + simple_form and jQuery UI. Datepicker is not working via turbolinks
body: <p>I have this form which calls datepicker:</p>
  
  <pre><code>...
  &lt;%= f.input :expiration_date, as: :datepicker, required: false %&gt;
  ...
  </code></pre>
  
  <p>Simple_form wrapper:
  <em>app/inputs/datepicker_input.rb</em></p>
  
  <pre><code>class DatepickerInput &lt; SimpleForm::Inputs::Base
    def input
      @builder.text_field(attribute_name, input_html_options) + \
      @builder.hidden_field(attribute_name, { :class =&gt; attribute_name.to_s + "-alt"})
    end
  end
  </code></pre>
  
  <p>When the page is loaded from scratch ( <em>$(document).ready</em> event ), the following html is generated:</p>
  
  <pre><code>&lt;input class="datepicker optional form-control hasDatepicker" id="order_expiration_date" name="order[expiration_date]" type="text"&gt;
  </code></pre>
  
  <p>However, when the page is loaded with turbolinks (from side nav bar, "page:load" event), the rendered HTML is the following:</p>
  
  <pre><code>&lt;input class="datepicker optional form-control" id="order_expiration_date" name="order[expiration_date]" type="text"&gt;
  </code></pre>
  
  <p>Of course, I can simply add <em>hasDatepicker</em> class in .html.erb or in application.js file, but I wonder if it's possible to achieve it with Rails functionality.</p>