I can successfully do...
<%= Time.now.strftime(''%m/%d/%Y %I:%M %p'') %>
but,
<%= property.created_on.strftime(''%m/%d/%Y %I:%M %p'') %>
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails
Oops... I hit send by mistake before I could finish composing.
I can successfully do...
<%= Time.now.strftime(''%m/%d/%Y %I:%M %p'') %>
but,
<%= property.created_on.strftime(''%m/%d/%Y %I:%M %p'') %>
generates an error
undefined method `strftime'' for nil:NilClass
''created_on'' is defined as "datetime" in MySQL. and
it works fine if I don''t
try to format it.
Is this a bug, or am I overlooking something simple.
I''m on Windows, running the lastest version of Rails.
Thanks.
On Apr 7, 2005 5:14 PM, Vick Nice
<victor.tolbert-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:>
> I can successfully do...
> <%= Time.now.strftime(''%m/%d/%Y %I:%M %p'') %>
> but,
> <%= property.created_on.strftime(''%m/%d/%Y %I:%M %p'')
%>
>
>
>
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails
On Apr 8, 2005 9:18 AM, Vick Nice <victor.tolbert-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Oops... I hit send by mistake before I could finish composing. > > > I can successfully do... > <%= Time.now.strftime(''%m/%d/%Y %I:%M %p'') %> > but, > <%= property.created_on.strftime(''%m/%d/%Y %I:%M %p'') %> > > generates an error > undefined method `strftime'' for nil:NilClassThis message is the equivalent of ''NullPointerException'' in java. Have you checked that property.created_on isn''t nil (null)?> ''created_on'' is defined as "datetime" in MySQL. and it works fine if I > don''t try to format it. > > Is this a bug, or am I overlooking something simple. > > I''m on Windows, running the lastest version of Rails. > > Thanks. > > > > > On Apr 7, 2005 5:14 PM, Vick Nice <victor.tolbert-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I can successfully do... > > <%= Time.now.strftime(''%m/%d/%Y %I:%M %p'') %> > > but, > > <%= property.created_on.strftime(''%m/%d/%Y %I:%M %p'') %> > > > > > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >-- Cheers Koz