Sign in or 

Model:And a typical generated view with "date_select:"
class RegistrationSetupinclude MongoMapper::Documentend
key :title, String, :required => true
key :open, Date
key :close, Date
View:
<p><%= f.label :from %><br /></p>
<%= f.date_select :from %>
The object save fails unless you deal with the date chunking. In addition the use of 3 spinners can be a bit laborious for the user. Naturally, in the controller, we could reassemble the constituent date parts into a Date... Blech. I'm too lazy for that. Plus I want a more modern date selector!
sudo gem install calendar_date_select
<%= javascript_include_tag :defaults %>
<%= calendar_date_select_includes %>
config.gem "calendar_date_select"
<div id="calendar"><p></div><%#= calendar_date_select_tag "e_date", Date.today, :embedded => true, :year_range => 0.years.ago..1.years.from_now %></p>
Open: <%= f.calendar_date_select :open, :size => 15 %>
Close: <%= f.calendar_date_select :close, :size => 15 %>
|
JonKern |
Latest page update: made by JonKern
, Sep 7 2010, 11:10 AM EDT
(about this update
About This Update
9 words deleted view changes - complete history) |
|
Keyword tags:
calendar
javascript
rails
ruby
More Info: links to this page
|