On Sun, Feb 3, 2013 at 8:36 AM, Johnneylee Rollins
johnneylee.roll...@gmail.com wrote:
Additionally, you can put it inside its own class and use that as necessary.
It'd be similar to the previous answer, but instead of including that
behaviour, you'd get an instance of that class and pass in
Hi!
If I have a method that is useful in both models and in views, where would
be the appropriate place to put it?
The method in question just takes two dates as strings, tries to parse them
and returns all dates in the range between them. It also takes care of the
issues when the dates are
On Sun, Feb 3, 2013 at 6:23 AM, Linus Pettersson
linus.petters...@gmail.com wrote:
If I have a method that is useful in both models and in views, where would
be the appropriate place to put it?
# config/initializer/preload_helpers.rb
require my_app/my_helper
# lib/my_app/my_helper.rb -
Additionally, you can put it inside its own class and use that as necessary.
It'd be similar to the previous answer, but instead of including that
behaviour, you'd get an instance of that class and pass in the strings
either in #initialize or the method you use to parse and call that method.
4 matches
Mail list logo