How do I connect jQuery Datepicker to my Ruby on Rails form?

前端 未结 7 2293
谎友^
谎友^ 2020-12-13 18:22

I\'m trying to use the jQuery Datepicker to set a date field in my Ruby on Rails form, but I can\'t work out how to do it. Can someone point me in the right direction?

7条回答
  •  感动是毒
    2020-12-13 18:52

    If using Rails 3.0+, you shouldn't need to do anything other than include jQuery and jQuery UI because jQuery is the default JavaScript framework.

    If using Rails earlier than 3.0 or using Prototype (or something else), you'll need to use jQuery in noConflict mode. Make sure you include jQuery after Prototype (your other framework) has been loaded using something similar to:

    
    
    
    

提交回复
热议问题