I am using the Rails helper datetime_select
in one of my forms. I currently have a requirement to change the dropdowns for day
, year
, hour
, and minute
to be textboxes with validation. Is there a way I can specify that I want textboxes for these fields? Or possibly a different helper that will do what I need?
here is my usage:
datetime_select(:campaign, :start_date, :order => [:day, :month, :year, :hour, :minute])
how about rolling your own simple helper, like
Feel free to add more formatting stuff/separators etc. but it basically returns to correct field names for rails to be identified as DateTime. Rails expects fields named like
date(1i)
, 1i = year, 2i = month etc.Honestly I didn't test it or anything, but the output in console looked pretty convincing ;)