In a Rails app I had a textfield/ jquery datepicker that degraded to date select fields (day, month, year). I'm midway through a major update, including updating gems and Rails version. My jquery function is now rendering three datepickers (one for each select field). Why would this happen? Or, what has changed within Rails that would cause this?
My code
<%= simple_form_for(@model,...... do |f| %>
<%= f.input :date, as: :date, order: [:day, :month, :year], input_html: { class: "date-selector" %>
<% end %>
And coffeescript
jQuery ->
data = $(".date-selector").data('date')
$(".date-selector").replaceWith(
$("<input type='text' class='date-picker' id='prerep_date' value='" + data + "' name='prerep[date]' >").datepicker)