From 2ed8adfe378594ae1585ac4a457a6d01f04478eb Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Fri, 19 Jul 2013 11:55:01 +0900 Subject: [PATCH] An Engine can include app/helpers, so let's move the helpers there however, leaving the original module as is for now, for Sinatra compatibility... --- app/helpers/kaminari_helper.rb | 5 +++++ lib/kaminari.rb | 1 - lib/kaminari/hooks.rb | 4 ---- 3 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 app/helpers/kaminari_helper.rb diff --git a/app/helpers/kaminari_helper.rb b/app/helpers/kaminari_helper.rb new file mode 100644 index 0000000..5244db5 --- /dev/null +++ b/app/helpers/kaminari_helper.rb @@ -0,0 +1,5 @@ +require 'kaminari/helpers/action_view_extension' + +module KaminariHelper + include Kaminari::ActionViewExtension +end diff --git a/lib/kaminari.rb b/lib/kaminari.rb index 41304ff..3028997 100644 --- a/lib/kaminari.rb +++ b/lib/kaminari.rb @@ -26,7 +26,6 @@ EOC # load Kaminari components require 'kaminari/config' -require 'kaminari/helpers/action_view_extension' require 'kaminari/helpers/paginator' require 'kaminari/models/page_scope_methods' require 'kaminari/models/configuration_methods' diff --git a/lib/kaminari/hooks.rb b/lib/kaminari/hooks.rb index 48d718a..706d113 100644 --- a/lib/kaminari/hooks.rb +++ b/lib/kaminari/hooks.rb @@ -28,10 +28,6 @@ module Kaminari ::Plucky::Query.send :include, Kaminari::PluckyCriteriaMethods end require 'kaminari/models/array_extension' - - ActiveSupport.on_load(:action_view) do - ::ActionView::Base.send :include, Kaminari::ActionViewExtension - end end end end