lib/deas/sinatra_runner.rb in deas-0.25.0 vs lib/deas/sinatra_runner.rb in deas-0.26.0
- old
+ new
@@ -13,10 +13,11 @@
@request = @sinatra_call.request
@response = @sinatra_call.response
@params = NormalizedParams.new(@sinatra_call.params).value
@logger = @sinatra_call.settings.logger
+ @router = @sinatra_call.settings.router
@session = @sinatra_call.session
super(handler_class)
end
@@ -58,10 +59,13 @@
@sinatra_call.headers(*args)
end
def render(template_name, options = nil, &block)
options ||= {}
- options[:locals] = { :view => @handler }.merge(options[:locals] || {})
+ options[:locals] = {
+ :view => @handler,
+ :logger => @logger
+ }.merge(options[:locals] || {})
options[:layout] ||= @handler_class.layouts
self.content_type(get_content_type(template_name)) if self.content_type.nil?
Deas::Template.new(@sinatra_call, template_name, options).render(&block)
end