Ruby on rails 插件是否存在,在我的rails应用程序中

Ruby on rails 插件是否存在,在我的rails应用程序中,ruby-on-rails,plugins,ruby-on-rails-2,Ruby On Rails,Plugins,Ruby On Rails 2,我正在开发rails2应用程序,主要是插件 我有两个插件,在我的第一个插件中,我必须检查第二个插件 插件存在,我如何做 现在,我正在使用第一个插件report\u designer。 控制器:自定义报告 在custom\u reports\u helper module CustomReportsHelper if File.exist?("#{Rails.root}/vendor/plugins/ReportVariablesHelper") include R

我正在开发
rails2
应用程序,主要是插件

我有两个插件,在我的第一个插件中,我必须检查第二个插件 插件存在,我如何做

现在,我正在使用第一个插件
report\u designer

控制器:
自定义报告

custom\u reports\u helper

   module CustomReportsHelper
     if File.exist?("#{Rails.root}/vendor/plugins/ReportVariablesHelper") 
       include ReportVariablesHelper
     end
   end
ReportVariablesHelper
来自第二个插件,名为
variables\u,用于\u数据

这是一个很好的解决方案还是RoR中的更好方法?您可以:

module CustomReportsHelper
  include ReportVariablesHelper if defined?(ReportVariablesHelper)
end

您将
HelperName
包含在哪个类(或模块)中?@MarekLipka我已经编辑了这个问题。好的,但它包含在哪个类(或模块)中?在第一个插件帮助程序中..这仍然不是我想要的。你把你的代码片段放在哪里?当包含在插件中时没有问题,但是没有包含帮助器操作。。