Displaying 20 results from an estimated 9000 matches similar to: "Less verbose than time_ago_in_words method?"
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)
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,
2008 Apr 04
0
Date.to_s format with time_ago_in_words
Hello,
Following this post''s instructions (http://railspikes.com/tags/date) I''m
trying to define a Date format like this:
ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.update(:date_ago
=> lambda { |date| date.strftime(''%a, %d %b, %I:%M%p'') + '' ('' +
time_ago_in_words(date) + '')'' } )
But it keeps giving
2006 Aug 17
4
using time_ago_in_words() in a controller?
I''m getting this error when I try to update a list using ajax after
submitting some data:
undefined method `time_ago_in_words'' for #<IdeaController:0x3a38ae8>
the LOC is this:
render_text "<li>" + @params[:idea][:title] + "<br />by " +
@params[:idea][:author] + " | " & time_ago_in_words(Time.now) & " ago |
" +
2008 Oct 11
1
Re: time_ago_in_words is off by a day
Look at your 1.day.from_now and see if it''s like this:
Sun, 12 Oct 2008 02:45:42 UTC +00:00
If you also have the "UTC +00:00", it means that you timezone is the
GMT (and I think that it isn''t your real timezone). For example, my
timezone is 3 hours after the GMT, so the right timezone would be
something like this:
Sat Oct 11 23:48:41 -0300 2008
At your
2011 Nov 02
4
undefined method `updated_at' for #<Classified:0x686c5e4>
HEllo, I have the following problem with rails, I am new in this...is
there anyone who explain to me what´s 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>
2006 Jan 22
6
*Very* basic layout question
I''m trying to use a different layout for just one action in my
controller, all the other actions use the application.rhtml layout, so
what i''m doing is ...
class SomeController < ApplicationController
layout "simple", :only=> :some_action
......
end
and the "simple" layout is applied to all the actions, can someone
please give me a hint?
2006 Aug 14
8
How search engine friendly are RoR sites?
I am a total RoR virgin, and took my first steps this weekend into the
Ruby world. A lot of sites I create need to be as SEO friendly as
possible, particularly for google. Before I delve any further, can
anyone tell me how friendly the dynamic URLs or if there is the usual
rewrite mod for rugby?
Thanks
Mike
--
Posted via http://www.ruby-forum.com/.
2006 Aug 12
7
Redirect back to last page?
I have a few pages where a user may do something (add tags, login, etc)
and I would like to redirect them back to the last page they were at
before calling that action. Is there an easy way to do this?
--
Posted via http://www.ruby-forum.com/.
2006 Jan 06
2
replace unkown action with 404
is there a way to replace unkown action error with a pretty 404 page ?
I set the ErrorDocument 404 in .htaccess, however when someong goes to
http://www.mysite.com/bogus i would like it to show a 404 error instead of
just "Uknown action".
Is this possible with a rescue or something?
adam
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 May 11
3
sanitize dangers
I''ve noticed that it is possible to pass javascript unaltered through
the sanitize function using CSS. For example:
sanitize( "<style
type=''text/css''>body{background-image:url(''javascript:window.alert(1)'')
}</style>" )
IE will execute the javascript. Firefox will not. I haven''t tried it
with any other browsers.
2010 Oct 11
5
Object lost in memory/trashed?
Hi,
I''ve got a problem on which I''ve spent many hours, and I can''t get a
clue on what is happening... I hope someone here will be able to help
me.
Here is the situation : my Rails app uses acts_as_commentable and
acts_as_bookmarkable on a Diagram model. Everything''s working OK
individually: I can create a comment on a Diagram, bookmark it, and so
on.
Now,
2007 Jan 13
6
nice date function
Hi:
you know the way the google and this forum presents dates? How it''s
measure from the current date/time and presents nicely as "39 minutes
ago", 2 days ago, etc.? Has anyone done a gem or other library object
that I can get to do those types of dates?
Thanks so much in advance!
Mike
--
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
2006 Feb 25
2
A Couple of Questions
Hi All,
I have been using Ruby and Rails for only a few short days and I am
loving it so far. I have a couple of questions relating to a specific
project I am working.
1. I am wondering about sessions expiring after a set period of in
activity and what would be the easiest way to set it up.
2. I would like to be able to users on the system. Each of these users
has a login of there own. Each
2006 May 14
6
file and directory layout below app/models
Hiall,
Is it possible to organize my model files below app/models into
subfolders? E.g. I would like to put admin related models into their
own subfolder. This kind of structuring works for controllers and
views (scaffolding creates the right subfolder-model mappings), but
app/models always stays flat. I''d really like to be able to group my
code into logical, well packages :-) Yes, I
2007 Feb 23
2
how to remove spaces from phone number
Hi,
I need to allow login based on the phone number. During the signup they
can give the number in any format with spaces, slash or (). But for
storing in database and then during login to compare I just want the 10
digit number. How can I remove the special char from phone number before
storing to db ?
Thanks.
--
Posted via http://www.ruby-forum.com/.
2006 Jan 17
5
simple question
How do I pass parameters from one controller to another during
redirect_to command? I want to pass both model and non-model objects.
The solution I use is via session, but I rather pass it as parameters to
the redirect_to
Thanks.
--
Posted via http://www.ruby-forum.com/.
2006 Jan 11
2
Wiki Home Page Has Spam Links
It seems the wiki-spam bot has been at work again. There are numerous
hidden links toward the top of the page that might be better gardened
out right away, if you know what I mean ;-|
--
Posted via http://www.ruby-forum.com/.
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