I'm using ryan bates nested form gem. - https://github.com/ryanb/nested_form
In nested form I have a textfield for jQuery datepicker.
My Problem is when I "Add a task". The datepicker no respond.
FYI - In my controller I generate 3.times for the nested form. All the 3 generated nested form, the datepicker work. Just when I add new or (delete and re-add), it wont work. - my jQuery datepicker script is in application.js
Looks old, but I'm posting mostly for my own sake.
If you use the code from the ryan Bates rails casts then you already have the helper. I didn't change that. I did however convert from coffeescript to javascript. I did this because I was getting a strange conflict that was needed to be cleared out. I also made a few additions.
Important: for this implementation, you have to add a class of datepicker.
I made a asset javascript file for this script and it works across the site once required into the application.js file.
Hope this helps
Thanks to the post at Adding a date picker to a nested form field & JQuery UI datepicker within rails nested forms & Rails 3 Nested Form - jQuery Datepicker won't load when "add a task"
Put this at the top of your view:
try adding the datepicker pluging after the row creation too :
it would look like this (the function names and class names will be different of course)