How to add calendar in a "form_for"
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.
精彩评论