A More User-friendly date_select() Alternative in Rails
ryan / Tue, 27 Jun 2006 05:56:00 GMT
This article has moved over to our sister spin-off blog, RubyJudo, which focuses on more arcane technical topics than NotRocketSurgery.
ryan / Tue, 27 Jun 2006 05:56:00 GMT
This article has moved over to our sister spin-off blog, RubyJudo, which focuses on more arcane technical topics than NotRocketSurgery.
I don’t know how to read date_select ’s return. I use @user.update_attribute(:birthday, params[:user][:birthday]) It reports a error.
I can understand why this would be confusing. The date data is parsed by ActiveRecord, so you generally need to do:
But, if you want more control, things get pretty kludgy. You can do this:
There might be a better way, but I don’t know of one.
using rails 1.2.x the @attribute trick doesn’t seem to work any longer. And I think that the better way to do this is to overload the attribute setter like so:
@class User < ActiveRecord::Base end@
that got mangled