A closer look at application_helper.rb show it contains a Module
definition. As this is particular to Rails, I think it is acceptable to
add my code here. Then in application_controller.rb I added the
Include ApplicationHelper statement. Testing show I am able to
access the defined methods, as required.
I also find $: to list the module search paths, but $! seem to return
nil.
Cheers!,
..k
: well, i think documentation for "require" explains where it searches for
: files.
:
: as far as i remember the path list is in $! variable. just add to it
: whatever you need to include more paths.
:
: konstantin
:
:
: : > : Hello,
: > :
: > : did you try to use the "require" functionality and put your methods in
: > to a
: > : file and just require it?
: > :
: > : konstantin
: >
: > You've reminded me to review Module and Mixins. It seems I should use
: > "require" and "include". But I am not sure where to place my new
: > module file so that both ApplicationController and ApplicationHelper
: > classes can "see" it. Is there a modules load PATH I should know about?
: >
: > Regards,
: >
: > .k
: >
: > :
: > : : > : >I have several methods that can have potential use in both the
: > : > controller and view. Currently there are two copies of each method,
: > : > one in the controller and the other in the helper.
: > : >
: > : > Does anyone know of another location where these methods can be
: > : > accessed by both? Thereby avoiding the duplication of code.
: > : >
: > : > Thanks,
: > : >
: > : > .k
: > : >
: > : >
: > :
: > :
: >
: >
:
: