Ruby on Rails Wednesday, December 15, 2010

I have following code in view

<% if @next_topic %>
Time to show next topic <%= distance_of_time_in_words(Time.now.utc,
@next_topic.time_to_show.utc) %>
<hr />
<% end %>

Output:

Time to show next topic {{count}} days

--------------------
time_to_show has following value

Mon, 20 Dec 2010 12:38:00 UTC +00:00

@next_topic comes from database. I am using SQLITE.

I am using Rails 2.3.8

I am using default settings for rest.

I have tried many things but failed.

Thanks
Amit

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment