Reputation: 484
This seems fairly trivial but is giving me hella grief!
I have a module in the lib folder.
require 'net/http'
module Weather
def get_response
NET::HTTP.get_response(URI.parse 'someURL').body
end
end
The controller.
class SunController < ApplicationController
include Weather
def show
logger.debug get_response
end
end
config/Application.rb
config.autoload_paths += %W(#{config.root}/lib)
And I get this error
uninitialized constant Weather::NET
I know the module is loaded correctly. What am I doing wrong?
Upvotes: 0
Views: 702