Rails 4 + simple_form and jQuery UI. Datepicker is not working via turbolinks
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have this form which calls datepicker: ... ... Simple_form wrapper: app/inputs/datepicker_input.rb class DatepickerInput attribute_name.to_s + "-alt"}) end end When the page is loaded from scratch ( $(document).ready event ), the following html is generated: However, when the page is loaded with turbolinks (from side nav bar, "page:load" event), the rendered HTML is the following: Of course, I can simply add hasDatepicker class in .html.erb or in application.js file, but I wonder if it's possible to achieve it with Rails functionality. 回答1