Forum: Ruby on Rails making a date object default to the last day of the month

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Mike Haggerty (Guest)
on 2006-06-07 23:53
hello all...question from a newbie trying to make a go at rails....

i have an account object which holds sundry information including a
credit card expiration date.  i use date_select ( "object", "method",
:order => [:month :year] ) to allow the user to select the month and
year of his credit card's expiration, but when this info is sent to the
model, somehow it defaults to a date object containing the correct
month, correct year, and the first day of the selected month.  since
credit cards dont expire until the end of the month, i want to be able
to have the default action be to set it to the end day of the selected
month.  i have figured out the logic if i have a date just
not sure where i should go about putting the code that does this...any
This topic is locked and can not be replied to.