I have a Rails app using jquery-ui datePicker.
Inside of a simple_form I have two fields. The first one is just a test field. The first one has datePicker working. I’m trying to get “data-behaviour” into the simple_form f.input line. But, I’ve got the wrong syntax.
<input type="text" data-behaviour='datepicker' >
<%= f.input :exp_date, :data-behaviour => 'datepicker', :as => :string, :label => 'Date', :input_html => {:value => Date.today.to_s} %>
This is my jquery:
$(document).on "focus", "[data-behaviour~='datepicker']", (e) ->
$(this).datepicker
format: "yyyy-mm-dd"
weekStart: 1
autoclose: true
How can I get the data-behavior=’datepicker’ into the f.input line?
Thanks!
Try something like