On 3 November 2011 13:01, Rolando Sotomayor <[email protected]> wrote:
> Well this time is another error...
> you are right...I check the DB and realize that the field updated_at it
> doesn't take any value itself, once I edit an item on my application.
> I've edited some items but no items took value at that field, but one
> item, ramdonly(I guess),This item is  the only one I can show, because
> is the unique that take value at this field into the DB...so the others
> records don't take value, that's why I got that error message
>
>>no implicit conversion to float from nil
>
> when I tried to show them.
>
> Why just one record is updated when I edited it...why the others don't?
> Is there any problem with my DB or with the application?

I am not sure what you did to fix the previous problem.  Did the field
not exist so then you added it?  If so then records that were in the
db before you added the field will not have a created_at entry, but
any new ones since then will have the date.  I can assure you that
there is a good reason for some having the date and others not, it is
not random, though it may not be clear what the reason is.

For the moment, to stop your view crashing, you could change the code
to something like
<%= distance_of_time_in_words_to_now(@classified.created_at) if
@classified.created_at %>

Colin

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to