lib/kaminari/helpers/sinatra_helpers.rb in kaminari-0.14.1 vs lib/kaminari/helpers/sinatra_helpers.rb in kaminari-0.15.0
- old
+ new
@@ -8,12 +8,17 @@
module SinatraHelpers
class << self
def registered(app)
app.register Padrino::Helpers
app.helpers HelperMethods
+ @app = app
end
+ def view_paths
+ @app.views
+ end
+
alias included registered
end
class ActionViewTemplateProxy
include Padrino::Helpers::OutputHelpers
@@ -29,10 +34,11 @@
@current_params.delete(@param_name)
end
def render(*args)
base = ActionView::Base.new.tap do |a|
+ a.view_paths << SinatraHelpers.view_paths
a.view_paths << File.expand_path('../../../../app/views', __FILE__)
end
base.render(*args)
end
@@ -123,10 +129,10 @@
I18n.load_path += Dir.glob(File.expand_path('../../../../config/locales/*.yml', __FILE__))
end
rescue LoadError
-$stderr.puts "[!]You shold install `padrino-helpers' gem if you want to use kaminari's pagination helpers with Sinatra."
+$stderr.puts "[!]You should install `padrino-helpers' gem if you want to use kaminari's pagination helpers with Sinatra."
$stderr.puts "[!]Kaminari::Helpers::SinatraHelper does nothing now..."
module Kaminari::Helpers
module SinatraHelper
def self.registered(*)