在我的rails应用程序中,我拥有需要并包含在控制器中的模块。 问题是:我必须重新启动应用程序,每次我在这些模块进行任何更改。 任何解决方案?在不重新启动rails的情况下更改ruby模块应用程序
例
包括模块
#rails_application/lib/services/test.rb
module Services
module TestService
def start
'Service started successfully'
end
end
end
控制器
#rails_application/app/controllers
class TestController < ApplicationController
require 'services/test.rb'
include Services::TestService
def index
render :text => start
end
end
请编辑您的问题,包括显示您如何在控制器中包含模块的代码。 – 2010-07-05 20:52:51