From ca6f890223f0aedb8510a33899e2fbd46a0a02ae Mon Sep 17 00:00:00 2001 From: Kyle Drake Date: Mon, 24 Jun 2013 14:49:27 -0700 Subject: [PATCH] prettier dev render --- environment.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/environment.rb b/environment.rb index a22ebf48..c2792400 100644 --- a/environment.rb +++ b/environment.rb @@ -51,3 +51,11 @@ Backburner.configure do |config| config.retry_delay = 200 config.respond_timeout = 120 end + +class Sinatra::Base + alias_method :render_original, :render + def render(engine, data, options = {}, locals = {}, &block) + options.merge!(pretty: self.class.development?) if engine == :slim && options[:pretty].nil? + render_original engine, data, options, locals, &block + end +end