In my rails application, i have modules which are required and included in the controllers.
The problem is: i have to restart the application every time i make any changes in these modules.
Any solutions?
Example
included module
#rails_application/lib/services/test.rb
module Services
module TestService
def start
'Service started successfully'
end
end
end
controller
#rails_application/app/controllers
class TestController < ApplicationController
require 'services/test.rb'
include Services::TestService
def index
render :text => start
end
end
In development, it should reload every you access.
In production mode, you can turn off cache by modifying
Change the following line to false.
And restart the application.
It reloads the changes without restarting the server.
Update
You might try
loadinstead ofrequire.