search for: distance_of_time_in_words_to_now

Displaying 13 results from an estimated 13 matches for "distance_of_time_in_words_to_now".

2006 Jan 27
2
distance_of_time_in_words_to_now
any idea how to use distance_of_time_in_words_to_now? -- Posted via http://www.ruby-forum.com/.
2013 Jan 02
4
distance_of_time_in_words_to_now
Hi There, As I have learned the hard way, let me discuss my question, idea or feature here before doing actual work on it... distance_of_time_in_words_to_now() seems to be unable to tell if this distance is in the future or in the past. I''d really like to see ''in 5 days'' or ''5 days ago'' depending on, well, if it was 5 days ago or will be in 5 days. I''ve googled and saw some gems, one by Radar, bu...
2006 Feb 01
1
distance_of_time_in_words_to_now with "ago" suffix
I wanted the distance_of_time_in_words_to_now method to have '' ago'' suffixed to it when the date is in the past, I assumed this would be the default behaviour but apparently not. I know of a REALLY messy way that i could solve this with, but it''s so ugly I can''t be bothered Does anybody have an easy, ele...
2006 Apr 22
1
Newbie question about using helpers in controllers
I''m trying to display a list of pages in xml. I want to change page.update_at to distance_of_time_in_words_to_now. However whenever I run it I get an error saying: undefined method `distance_of_time_in_words_to_now'' I know I can just go the rails api and copy the source, but there must be another way. def list @page = Page.find(:all, :order => "updated_at desc") for page in @page page...
2009 Sep 09
0
distance_of_time_in_words_to_now and i18n
Hello, Im using this method and sometimes getting errors like this: I18n::InvalidPluralizationData in Forums#show Showing app/views/forums/show.html.erb where line #13 raised: translation data {:one=>"1 minuto", :many=>"{{count}} minutos"} can not be used with :count => 2 It only happens when using localization (I have the file, pt-br.yml and its ok, I checked it
2005 Dec 27
3
created_on & updated_on - helper to display date only
All, My initial list is rather busy. I would like to shorten the created_on and updated_on fields to just display the date, not the time. Best wold be a simple 12/28/05 type of presentation. I''ve found the format helpers in rdoc. (ie. distance_of_time_in_words_to_now ), but none seem to be what I''m looking for. How do I control the date format of a timestamp field? Thanks Greg -- Greg Freemyer The Norcross Group Forensics for the 21st Century
2010 Sep 07
2
Help on formatting some HAML
...true %></li> <span class="rightside"><%= link_to ''Delete'', order, :confirm => ''Are you sure?'', :method => :delete %></span> <li class="time_space"><span class="quiet small time"><%= distance_of_time_in_words_to_now(order.created_at, :include_seconds => true) %> ago</span></li> <% end %> </ul> </div> <div class="page_nav"> Pagination goes here </div> <br /> </div> ---- I have tried it a few different ways to convert t...
2006 May 10
3
formatted date down-counter - help!
I''d like to have a count down to a certain date, but display it in words, such as "123 days away" or something. I''m aware of the function "distance_of_time_in_words_to_now()", which will display "about 6 hours" or "12 days" or something like that, but how can I get it to reverse? Pass it a date for future reference, then it will error or be negative, right? Any thoughts? Thanks... -- Posted via http://www.ruby-forum.com/.
2006 Jun 18
2
convert timespan to verbose description
Hi, I always see RoR pages showing the elapsed time like that ''Published 3 days, 23 hour and 5 minutes ago'' ''Published less than 3 minutes ago'' I guess this conversion can be done using a Rails function, however I can''t find it. Does somebody know its name?? Thanks a lot Peter
2008 May 27
0
How to find Date and Time difference in controller?
Hi, I need a method similar to "distance_of_time_in_words_to_now" to be used in the controller. "distance_of_time_in_words_to_now" methods work only in view. Thanks, Ratnavel. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups...
2011 Nov 02
4
undefined method `updated_at' for #<Classified:0x686c5e4>
...happens? Thanks See below: NoMethodError in Classified#show Showing app/views/classified/show.rhtml where line #17 raised: undefined method `updated_at'' for #<Classified:0x686c5e4> Extracted source (around line #17): 14: 15: <strong>Date Posted:</strong> <%= distance_of_time_in_words_to_now(@classified.created_at) %> ago <br /> 16: 17: <strong>Last updated:</strong> <%= distance_of_time_in_words(@classified.updated_at, Time.now) %> ago </p> 18: <p><%= @classified.description %></p> 19: 20: <hr/> RAILS_ROOT: ./scri...
2006 Mar 30
4
Simple Ruby/Rails question, doing posted hours ago
I am not the Ruby aficionado yet, if I have created_on ...timestamp. What is a ruby way of getting the hours/minutes/seconds ago. is there some class that has this implemented. For example: Posted on 3/28/2006 Show a time with: posted: 1 day ago ... something along those lines. -- Berlin Brown (ramaza3 on freenode) http://www.newspiritcompany.com also checkout alpha version of botverse:
2008 Feb 03
4
Testing helper/view methods from script/console
Hi, Is it possible to test helper/view methods from script/console. I want to test the output of methods like distance_of_time_in_words. But it won''t let me from the console. What am I missing? TIA Luke -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on