Time based web applications written in rails and javascript will sooner or later have to think about the following object life cycle.
- Javascript Object
- Request Params
- Rails object
- MySQL row
While rails has the last two covered and jQuery has mostly the second covered how do we get our data in to a form where this flow will be smooth. Javascript date objects don’t directly fit so I extended the date prototype to allow for this. This porototype mirrors the rails date time form helper and creates the correct data with the keys rails would expect to have.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | |
As far as rails is concerned we might as well be using the datetime helper.