search for: format_tim

Displaying 6 results from an estimated 6 matches for "format_tim".

Did you mean: format_time
2006 May 16
4
question about strftime when called from partial.
Hi, I''m calling a helper I''ve written - format_time() that is called from my views with a given time that was selected from my database and was returned to the view via an instance variable. When I call format_time from a partial, I see that I get some kind of String error and the partial won''t render. Basically, the object being passed...
2006 May 13
1
undefined method `strftime'', being called from a partial.
Hi, I''m having an issue with calling a function that I''ve defined in ApplicationHelper called format_time: module ApplicationHelper def format_time(time) time.strftime("%a %b %d, %I:%M%p") end end I use this function in my views to format the Time.now that I would have stored in my tables as a DATETIME. I''m able to use this function, without any issues from my views, bu...
2006 Jan 05
2
how to use a helper which is not inside app/helpers/
Hi, I wish to know it is possible to use a helper which is not inside the folder ''app/helpers'', if it is possbile, what should I do? Thanks you very much!!!! Saiho __________________________________________ Yahoo! DSL ? Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com
2006 Jan 09
5
Formatting timestamp objects
...a date like this: Sunday, January 8 2006 I don''t want it to print January 08. For the time, I want it to look like this: 9:08 pm Not 09:08 and lower case PM. I created these methods: def format_date(date) date.strftime("%A, %B #{date.day} #{date.year}") end def format_time(date) if date.hour > 12 hour = date.hour - 12 elsif date.hour == 0 hour = 12 else hour = date.hour end time = "#{hour}:#{date.min} " if date.hour > 12 time += "pm" else time += "am" end end There h...
2006 Nov 01
2
How to: Individualized mass email with ActiveMailer - separate thread?
...on, with fields such as [:name:] # filled with the person''s name raw_email = PeopleMailer.create_general_email(email, p, sent_at) raw_email.set_content_type("text/html") begin PeopleMailer.deliver(raw_email) rescue Exception => e email.log += "\n" + format_time(Time.now) + "\n" + e.message + "\n" end end The problem is that generating the 500 individual emails takes a significant amount of time, which causes the browser to time out. What we want, is to give the user a response immidiately, and then process the sending of the email...
2010 Aug 13
0
Rails 2 and Rails 3 in the same gemset leads to errors
...ject=>Fri Aug 13 16:15:41 +0200 2010} given)) on line #4 of app/views/my/_sidebar.rhtml: 1: <h3><%=l(:label_my_account)%></h3> 2: 3: <p><%=l(:field_login)%>: <strong><%= @user.login %></strong><br /> 4: <%=l(:field_created_on)%>: <%= format_time(@user.created_on) %></p> 5: 6: 7: <h4><%= l(:label_feeds_access_key) %></h4> /var/www/vhosts/mydomain.org/.rvm/gems/ruby-1.8.7-p299/gems/ i18n-0.4.1/lib/i18n/backend/base.rb:186:in `interpolate_without_deprecated_syntax'' /var/www/vhosts/mydomain.org/.rv...