Last active
December 20, 2015 12:28
Redmine はプラグインの app/{controllers,models,helpers} しか自動的にロードしてくれないので、その他のディレクトリをロードさせる
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Redmine::Plugin.register :hoge do | |
# other plugin settings | |
# simple | |
ActiveSupport::Dependencies.autoload_paths += [File.dirname(__FILE__) + "/app/forms"] | |
# multiple | |
Dir.glob(File.expand_path(File.join(File.dirname(__FILE__), "app", "{forms,services}"))) do |dir| | |
ActiveSupport::Dependencies.autoload_paths += [dir] | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment