In my application_helper.rb file, I have a function like this:
def internal_request? server_name = request.env['SERVER_NAME'] [plus more code...] end
This feature is required in controllers, models, and views. So, I put this code in the utility function file in the lib/ directory. However, this did not help: I ββreceived request complaints that were not defined.
How can I access the request object in a file in the lib/ directory?
ruby-on-rails request helpers
rlandster
source share