Skip to content

Commit

Permalink
Sets content type after rendering view to have a chance to modify it …
Browse files Browse the repository at this point in the history
…internally from the view itself
  • Loading branch information
fgrehm committed Jun 15, 2012
1 parent 0a64ab3 commit 66c6e13
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/harbor/response.rb
Expand Up @@ -209,13 +209,13 @@ def render(view, context = {})
view = View.new(view, context.merge({ :request => @request, :response => self }))
end

self.content_type = view.content_type

if context.has_key?(:layout) || @request.xhr?
puts view.to_s(context[:layout])
else
puts view.to_s(:search)
end

self.content_type = view.content_type
end

HEADER_BLACKLIST = ['X-Sendfile', "Content-Disposition"]
Expand Down

0 comments on commit 66c6e13

Please sign in to comment.