How would I go about using helper methods from a config file?
This may be unorthodox but it makes sense in the context that I need it. The helper method I need is used to properly format URLs in one of my views. The config file is the initializer for the sitemap_generator Gem, where I need the helper method to format some of the URLs.
I tried require, which does indeed include the module, but get undefined method for module when I call it.
This is how you include your helper in the SitemapGenerator config :
SitemapGenerator::Interpreter.send :include, ApplicationHelper
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With