Permalink
Browse files

allow passing options to the engine in render

  • Loading branch information...
1 parent 988874c commit 47838f6b58e6819d8bcd452b61af592553d9be4a @madx committed Nov 3, 2011
Showing with 6 additions and 5 deletions.
  1. +5 −4 lib/roy/render.rb
  2. +1 −1 lib/roy/version.rb
View
@@ -4,16 +4,17 @@ module Roy
module Render
def render(engine, view_or_string, params={}, &block)
- tilt = case view_or_string
+ options = roy.conf.render || {}
+ template = case view_or_string
when Symbol
file = [view_or_string.to_s, engine].map(&:to_s).join('.')
dir = roy.conf.views || 'views'
- Tilt.new(File.join(dir, file))
+ Tilt.new(File.join(dir, file), nil, options)
else
- Tilt[engine].new { view_or_string.to_s }
+ Tilt[engine].new(nil, nil, options) { view_or_string.to_s }
end
- tilt.render(self, params, &block)
+ template.render(self, params, &block)
end
end
View
@@ -1,3 +1,3 @@
module Roy
- VERSION = "0.2.1"
+ VERSION = "0.2.2"
end

0 comments on commit 47838f6

Please sign in to comment.