mirror of
https://github.com/kaminari/kaminari.git
synced 2022-11-09 13:44:37 -05:00
Merge pull request #332 from hooktstudios/sinatra-views
Add support for Sinatra views overrides (add app views paths)
This commit is contained in:
commit
5f62aa5966
1 changed files with 6 additions and 0 deletions
|
@ -10,6 +10,11 @@ module Kaminari::Helpers
|
|||
def registered(app)
|
||||
app.register Padrino::Helpers
|
||||
app.helpers HelperMethods
|
||||
@app = app
|
||||
end
|
||||
|
||||
def view_paths
|
||||
@app.views
|
||||
end
|
||||
|
||||
alias included registered
|
||||
|
@ -31,6 +36,7 @@ module Kaminari::Helpers
|
|||
|
||||
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)
|
||||
|
|
Loading…
Reference in a new issue