I'm wanted to make a "global" module that I could include in my
application for some shared code between them. I've been making
several camping apps and wanted them all to share a helper/partial
that contained the navigation.
I ran into a lot of difficulty when trying to include it, the primary
problem being "methodUndefined" errors. I did finally get it to work,
but I'm not sure why. Here's the relevant bits:
my_app.rb
MyApp::Helpers
include Global::Helpers
def month_name
...helper code
end
end
MyApp::Views
def layout
...some markaby
:navigation #throws an UndefinedMethod error if not a symbol
...some more markaby
end
end
global.rb
module Global
module Helpers
def navigation
...what i need
end
end
end
If I list the instance methods in irb, both "navigation" and
"month_name" shows up. However, I have to use use :navigation as a
symbol in my view as opposed to just using month_name for the other.
Both are defined as instance methods.
What gives with the symbol usage?
_______________________________________________
Camping-list mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/camping-list