Permalink
Browse files

to avoid a load order issue, users must extend their application cont…

…rollers with DelegatePresenter::ApplicationController manually.
  • Loading branch information...
rwilcox committed Oct 20, 2011
1 parent ae00808 commit ebbefc7f981d3cbb77186ad0f156974347d11959
Showing with 9 additions and 5 deletions.
  1. +3 −2 README.markdown
  2. +6 −3 lib/delegate_presenter/application_controller.rb
View
@@ -45,8 +45,9 @@ Installation
================================
1. Add me to your Gemfile
2. In your `config/application.rb`, add an autoload path for `app/presenters/`
3. Create presenters for your classes. For example: `app/presenters/todo_presenter.rb`. These classes should subclass `DelegatePresenter::Base`
2. In your ApplicationController `extend DelegatePresenter::ApplicationController`
3. In your `config/application.rb`, add an autoload path for `app/presenters/`
4. Create presenters for your classes. For example: `app/presenters/todo_presenter.rb`. These classes should subclass `DelegatePresenter::Base`
Credit where Credit Is Due
@@ -1,3 +1,9 @@
# This module adds a method so DelegatePresenter::Base can access your Rails helpers
# You'll need to extend your ApplicationController with this module name
#
# Earlier versions of the gem extended ApplicationController for you, but introduced bugs
# (possibly dealing with load order???) WD-rpw 10-20-2011
module DelegatePresenter::ApplicationController
# Provide access to helper methods from outside controllers and views,
# such as in Presenter objects. Rails provides ActionController::Base.helpers,
@@ -28,6 +34,3 @@ def _routes
end
end
#class ApplicationController
# extend DelegatePresenter::ApplicationController
#end

0 comments on commit ebbefc7

Please sign in to comment.