nmerouze / action_presenter

action_presenter / init.rb
100644 15 lines (12 sloc) 0.475 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
ActiveSupport::Dependencies.load_paths << Rails.root + '/app/presenters'
 
config.after_initialize do
  Rails.plugins.each do |plugin|
    path = plugin.directory + "/app/presenters"
  
    if File.directory?(path)
      ActiveSupport::Dependencies.load_paths << path
      ActionPresenter.view_paths << path
    end
  end
end if defined? :Engines
 
ActionView::Base.__send__ :include, ActionPresenter::Helpers
ActionController::Base.__send__ :include, ActionPresenter::Helpers