How call distance_of_time_in_words() from a controller instead of a
view?

Reference:
http://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#M001712

This page says this method is in: Module ActionView::Helpers::DateHelper

which also says is here:

in:    actionpack/lib/action_view/helpers/date_helper.rb

BUT, HOW IN THE WORLD do I get that included in my controller file?

1) This doesn't work inside the class definition:

require "date_helper"

as I get this message:

 MissingSourceFile in MyController#datePage

no such file to load -- date_helper

2) THEN, when I try this:

helper :date_helper

I get this:

Missing helper file helpers/date_helper_helper.rb

Please help!  I bet this is cake if I just know the solution.

Thanks very much in advance,

Pete
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to