Displaying 20 results from an estimated 600 matches similar to: "distance_of_time_in_words and Time classes"
2010 Dec 15
4
distance_of_time_in_words shows {{count}} days instead of showing actual days
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
2007 Sep 18
0
distance_of_time_in_words hardcoded strings should be separated for easier localization
Hi everybody.
After DHHs talk at RailsConf yesterday, it''s essential that some of
you can rectify this patch for ruby on Rails
Please help me an have a look at
http://dev.rubyonrails.org/ticket/9587
Thanks!
Jesper Rønn-Jensen
blog: www.justaddwater.dk
=====
ActiveRecord::Errors has a placeholder (@@default_error_messages) for
messages that can be overridden.
Just the same way, the
2008 May 20
2
DateHelpers .. don' display.. ?
HI
I don''t understand what happen ..
if I use the script/console :
>> include ActionView::Helpers::DateHelper
=> Object
>> include GLoc
=> Object
>> time_ago_in_words(Time.now, include_seconds = false)
=> "moins d''une minute"
I get the correct answer..
but I I write in my view
<%= time_ago_in_words(Time.now, include_seconds = false)
2006 Jul 14
1
Converting Date string to Time Object
Hi,
I have MySQL model with created_on specified as :date. This means that the
day the record was created on is stored in the database as a string like
"2006-04-28". I want to be able output a something like "5 days ago". From
looking in the API I''ve found "strftime" and "*distance_of_time_in_words*".
Distance_of_time_in_words only accepts Time
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
2007 Jul 31
11
helper spec not finding rails core helpers
Hi,
My helper specs were going ok until I added a call to a rails
DateHelper method in one of my helpers
http://api.rubyonrails.com/classes/ActionView/Helpers/
DateHelper.html#M000574
The helper runs fine from my view templates, just dies in the spec test.
I boiled my question down to a simple (not too useful) example. I''m
not sure what I''m missing.
#
2007 Feb 21
2
date helper bug?
I''ve found an issue when trying to use the time_ago_in_words and
distance_of_time_in_words from action view''s date_helper.rb
Using SQL Server, I have a datetime column that gets returned as:
"2007/02/21 09:54:00". When I pass this to time_ago_in_words (which
just passes on to distance_of_time_in_words) it miscalculates the
difference as "9 hours" (...um yeah,
2006 Sep 06
7
Error on Windows and FreeBSD
First off Windows, because actually what I appear to be getting is a
Rails error which only occurs when I use Mongrel, using Webrick I do not
get this error.
I start Mongrel using:
mongrel_rails start
I have mongrel, win32-services and mongrel-service gems installed even
through Im not using mongrel as a service at the moment.
The whole application works apart from one action. The error I get
2008 Dec 22
2
methods vs. functions
Dear List,
a second, more general, question concerning S4 classes.
I have a bunch of functions/methods for my class.
At the moment I have them as methods, because they work on objects of my S4
class and therefore "belong" to that class.
On the other hand, it is comparably unlikely that someone else wants the same
kind of method.
And package.skeleton () produces the
2011 May 23
4
Distance of time in days
In rails 3 there is distance_of_time_in_words which works fine, but I would like to tweak its output a bit.
The thing is that if the dates are exactly the same it will say "Less Than a Minute" I would like it to show "Today" instead.
Is that possible?
Tiago Veloso
ti.veloso-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
--
You received this message because you are subscribed to
1999 Apr 08
0
Keep-timestamp-in-`get'-patch for smbclient in samba-2.0.3
--------
--Multipart_Thu_Apr__8_13:33:51_1999-1
Content-Type: text/plain; charset=US-ASCII
Hello guys,
I always wondered why smbclient keeps timestamp in `put'ting a file
but does not keep it in `get'ting a file. Alternative to keep the
time stamp in `get'ting file is to use -Tc option or smbtar script,
but they are a bit hairy for interactive use, and it can only dump
files with an
2012 Feb 10
4
Problems running application fixme:odic:SQLConfigDataSource
I have successfully started application but then it should have list of servers it must connect but it is empty and the only errors in terminal are those:
Code:
XZY:~ XZY$ XZY.desktop ; exit;
XZY.desktop: line 1: [Desktop: command not found
fixme:odbc:SQLConfigDataSource 0x0 1 "SQL Server" "DSN=XZY1"
fixme:odbc:SQLConfigDataSource 0x0 1 "SQL Server"
2008 Apr 28
0
(no subject)
Hi R users
Here is an example of my data (only a small part)
Year Season A_Time R_Time O_Time All_Time AandR_Time
A_number R_number O_number AandR_number all_number
1999 Winter 9.590741 35.312963 42.759524 23.228431 18.164815
18 9 7 27
34
2000 Winter 9.899537 47.945000 59.744444 20.301333 18.170290
36 10 3
2008 Apr 28
0
Two graphs on one using barchart
> Hi R users
> Here is an example of my data (only a small part)
>
> Year Season A_Time R_Time O_Time All_Time AandR_Time
> A_number R_number O_number AandR_number all_number
> 1999 Winter 9.590741 35.312963 42.759524 23.228431 18.164815
> 18 9 7 27
> 34
> 2000 Winter 9.899537 47.945000 59.744444 20.301333
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
2006 Sep 04
11
balancer://mongrel_cluster
A couple of questions please:
What is the benefit of having more than one Mongrel/Rails instance on
the same machine, could one instance not serve as many requests as say
three instances?
Is Mongrel Cluster a Apache add-in (like mod_*) or a separately running
load balancer which runs on a separate port, I could not work it out
from the sample Apache config...
|# Redirect all non-static
2006 Sep 25
5
HTTP Parser (Regal)
Hi I was interested to see how Mongrel uses Lex/Yacc to parse the HTTP
requests using a Regal generated parser. I downloaded the source but do
not see the lex and yacc files...
2020 Sep 24
4
cifsacl not working
I installed a new Ubuntu 20.4 LTS system (smbd 4.11.6) . Initially I
tried using the SSSD and 'realm' to join the domain. Everything worked
similar to my Centos 7 install and I thought I was finished.
The one thing not working is? cifs shares showing the proper id mapping.
Based on some online posts, including from Rowland, I got rid of SSSD
and configured samba/winbind only. Lots of
Unable to figure out why a photo attribute of the paperclip plugin is not being passed in as a param
2011 May 20
4
Unable to figure out why a photo attribute of the paperclip plugin is not being passed in as a param
Hello all,
I am trying to implement a feature in my app where a user posts a
message along with an image.
This is something similar to what is there in `www.diasp.org` .
I dealing with a pretty much outdated configuration of Rails 2.0.2 and
Ruby 1.8.7 , both running on Ubuntu 10.04 OS for project specific
purposes.
Initially, I found a problem in finding an appropriate plugin for
paperclip
2007 Mar 08
10
bad URI(is not URI?): c:\boot.ini
Please note this message is not related to my previous one from
yesterday, this is on a different server (textdrive server).
I have only one mongrel application running but ''randomly'' it will go
down, the mongrel.log file shows:
ERROR: undefined method ''request_uri'' for #<URI::Generic:0x5383948 URL:*>
ERROR: bad URI(is not URI?): c:\boot.ini
[FATAL]