juretta.com

Rails: Setting Content Type

June 07, 2005
Tags: Dropbox Rails
class ApplicationController < ActionController::Base

  before_filter :set_default_content_type

  def set_content_type(content_type)
    @response.headers["Content-Type"] = content_type
  end

  def set_default_content_type
    set_content_type("text/html; charset=utf-8")
  end
end

About

This is the defunct blog of Stefan Saasen.