Hi, I''m trying to assign a date to a variable in a method from a
controller:
def create
@recipe.date = Date.today
end
All I get is a null date.
I''m seraching Date clas at Ruby reference but I haven''t found
anything but Time.
Is Date class working on ruby-1.8.2-7 or is it obsolete?
--
/ Eduardo Yáñez Parareda /
> Try @recipe.date = Time.nowYes, it works!, but why doesn''t work Date class? -- / Eduardo Yáñez Parareda /
> Hi, I''m trying to assign a date to a variable in a method from a controller: > def create > @recipe.date = Date.today > end > > All I get is a null date. > I''m seraching Date clas at Ruby reference but I haven''t found anything but Time. > > Is Date class working on ruby-1.8.2-7 or is it obsolete?Try @recipe.date = Time.now Mike