mirror of
https://github.com/kaminari/kaminari.git
synced 2022-11-09 13:44:37 -05:00
Add support for Sinatra views overrides (add app views paths)
This commit is contained in:
parent
2e09b5374f
commit
63b6f74d06
1 changed files with 6 additions and 0 deletions
|
@ -10,6 +10,11 @@ module Kaminari::Helpers
|
||||||
def registered(app)
|
def registered(app)
|
||||||
app.register Padrino::Helpers
|
app.register Padrino::Helpers
|
||||||
app.helpers HelperMethods
|
app.helpers HelperMethods
|
||||||
|
@app = app
|
||||||
|
end
|
||||||
|
|
||||||
|
def view_paths
|
||||||
|
@app.views
|
||||||
end
|
end
|
||||||
|
|
||||||
alias included registered
|
alias included registered
|
||||||
|
@ -31,6 +36,7 @@ module Kaminari::Helpers
|
||||||
|
|
||||||
def render(*args)
|
def render(*args)
|
||||||
base = ActionView::Base.new.tap do |a|
|
base = ActionView::Base.new.tap do |a|
|
||||||
|
a.view_paths << SinatraHelpers.view_paths
|
||||||
a.view_paths << File.expand_path('../../../../app/views', __FILE__)
|
a.view_paths << File.expand_path('../../../../app/views', __FILE__)
|
||||||
end
|
end
|
||||||
base.render(*args)
|
base.render(*args)
|
||||||
|
|
Loading…
Reference in a new issue