Permalink
Browse files

Merge pull request #332 from hooktstudios/sinatra-views

Add support for Sinatra views overrides (add app views paths)
  • Loading branch information...
2 parents ef4eee1 + 63b6f74 commit 5f62aa596658f444da336d409c4d104672fa0b6e @udzura udzura committed Mar 7, 2013
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/kaminari/helpers/sinatra_helpers.rb
@@ -10,6 +10,11 @@ class << self
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 @@ def initialize(opts={})
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)

0 comments on commit 5f62aa5

Please sign in to comment.