Hello
It seems that datetime_select, is creating an instance of the Time class. Why would that be?
I found this while building a site where people can create vigils (prayer vigils, peace vigils, etc). When I added a validation method that compared start_date to created_at, it generated the error:
ArgumentError (comparison of Time with DateTime failed):
I was able to put a breakpoint in the create action of my vigil controller and found that @vigil.start_date.class returns Time type.
I'm running Rails 1.2.3 on Ruby version 1.84.20 on a Windows XP box.
The relevant code is:
View: <%= datetime_select 'vigil', 'start_date' %></p>
Vigil Controller:
def new s = DateTime.now e = s.succ @vigil = Vigil.new(:start_date => s, :end_date => e) end
def create @vigil = Vigil.new(params[:vigil])