lib/locomotive/builder/server/renderer.rb in locomotivecms_builder-1.0.0.alpha2 vs lib/locomotive/builder/server/renderer.rb in locomotivecms_builder-1.0.0.alpha3
- old
+ new
@@ -4,15 +4,15 @@
class Renderer < Middleware
def call(env)
self.set_accessors(env)
- puts "[Builder|Renderer] page = #{page.inspect}"
-
if self.page
if self.page.redirect?
- [self.page.redirect_type, { 'Location' => self.page.redirect_url, 'Content-Type' => 'text/html' }, []]
+ self.redirect_to(self.page.redirect_url, self.page.redirect_type)
else
+ self.log "Rendered liquid template"
+
type = self.page.response_type || 'text/html'
html = self.render
[200, { 'Content-Type' => type }, [html]]
end
\ No newline at end of file