I’m just curious about what techniques others have successfully used to
capture date data on forms as an alternative to the standard
date_select. I
have to admit I’ve been lazy and only used the date_select as we have
very
few dates in our system now, but that is about to change. I would like
something better.
The programming interface seems a bit awkward to me, though. For
example:
<% @dateField = model.date %>
<%= date_box %>
Rather than something like
<%= date_box “model”, “date”, { options } %>
It also seems to insist on outputting an integrated help box and
additional date label, which I personally don’t want or need. However,
the actual date picker is quite nice.
Both popup_calendar and date_box use the same JS library, but I much
prefer the way that popup_calendar behaves like other form helpers and
lets you set configuration options.
However, it’s nice that date_box is set up as an engine since it
allows you to keep all of those extra .js, .css, and .gif files out of
your main public folder.
So I went ahead and converted popup_calendar into an engine and it
works great! I’ll test it for a few days and submit it… somewhere.
If anyone would like me to just send them the code, let me know.
I had used the Dynarch calendar previously in some php applications. I
had to do a little tweaking to get it how I wanted, however. (Having a
displayed input with a user-friendly format and a hidden field for the
mysql format, making it read-only and having a delete button, etc.)
When all was said and done the code to use it was just like any other
form helper:
Both popup_calendar and date_box use the same JS library, but I much
prefer the way that popup_calendar behaves like other form helpers and
lets you set configuration options.
However, it’s nice that date_box is set up as an engine since it
allows you to keep all of those extra .js, .css, and .gif files out of
your main public folder.
So I went ahead and converted popup_calendar into an engine and it
works great! I’ll test it for a few days and submit it… somewhere.
If anyone would like me to just send them the code, let me know.
-Eli
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.