Skip to content

Commit

Permalink
Forcing text/html content_type with render_html method.
Browse files Browse the repository at this point in the history
For some reason cms content_controller doesn't return any content type in response headers.

This manifested itself after switching to rails 3.2. Normally you wont notice it but with opera browsers it suggests
you to save the page instead of viewing the page (saving html-file instead of displaying it).

Following was from firebug:
```
Content-Type	; charset=utf-8
```
  • Loading branch information
holli committed Mar 18, 2012
1 parent c9245f8 commit 18a21dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/cms_content_controller.rb
Expand Up @@ -14,7 +14,7 @@ class CmsContentController < ApplicationController
def render_html(status = 200)
if @cms_layout = @cms_page.layout
app_layout = (@cms_layout.app_layout.blank? || request.xhr?) ? false : @cms_layout.app_layout
render :inline => @cms_page.content, :layout => app_layout, :status => status, :content_type => :html
render :inline => @cms_page.content, :layout => app_layout, :status => status, :content_type => 'text/html'
else
render :text => I18n.t('cms.content.layout_not_found'), :status => 404
end
Expand Down

0 comments on commit 18a21dd

Please sign in to comment.