开发者

How to add calendar in a "form_for"

开发者 https://www.devze.com 2023-02-05 06:32 出处:网络
I am new in Rails, currently, I am working on my form (using \'form_for\'), for some reason, I have to use form_for, can not use *sematic_form_for*, please don\'t ask me to use that.

I am new in Rails, currently, I am working on my form (using 'form_for'), for some reason, I have to use form_for, can not use *sematic_form_for*, please don't ask me to use that.

My question is if I stick to use form_for, is there any way to implement a calendar selection field for date selection. (I know 开发者_如何学Gothere is 'select_date' and 'date_select' helper, but they are drop down menus)

=form_for :myobject do |form|
  =form.??? /how to add a calender selection here??


I'd recommend using date_select so that users who do not or cannot effectively use JavaScript can still interact with your form.

That said, for those users who do have JavaScript enabled, the jQuery UI Datepicker is very slick and can integrate with Rails.

This blog post contains some details about integrating with Rails, and though it uses formtastic, it can be adapted.

0

精彩评论

暂无评论...
验证码 换一张
取 消