I have a rails app that loads lots of data from some java services. I'm writing a module that will allow me to populate some select boxes with this data and I'm trying to include these properly so I can reference them in my views. Here's my module
module FilterOptions
module Select
def some_select
return "some information"
end
end
end
My idea was to include FilterOptions in my application_helper, and I thought I could then reference my methods using Select::some_select
This is not the case. I have to include FilterOptions::Select
then I can reference the method some_select
on its own. I don't want that though as I think it's a bit confusing to someone that may not know that some_select
is coming from my own module.
So, how do I write methods of a module that are like public static methods so I can include my main module, and reference my methods using the sub-module namespace like Select::some_select