hoodwink.d enhanced
 

juretta.com

Rails: Setting Content Type | June 07, 2005-->

June 07, 2005
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
@09:15 | Comments: 3 | Tags: Dropbox (35), Rails (30)

Diggman

1
Chris Nolan.ca says:
Avatar Wed Apr 12 05:01:27 +0200 2006 | #

Thanks for the tidbit.
FYI, on my system utf-8 needed to be UTF-8 inorder to work for some reason?

2
Chris Nolan.ca says:
Avatar Wed Apr 12 08:11:59 +0200 2006 | #

Me again, turns out this breaks RJS. See here for details – http://newbieonrails.topfunky.com/articles/2006/02/01/rjs-and-content-type-header

3
Stefan says:
Avatar Tue Apr 25 18:15:10 +0200 2006 | #

Hi Chris,
yeah i notcied that setting the content type in application_controller this way breaks RJS. Thanks for the pointer!

About

juretta.com is the personal workspace of Stefan Saasen. You can send him an email or read more about this site in the „About“ section.

« Previous entry

Installing Subversion on Mac OS X "Ti...
posted over 3 years ago

» Next entry

Nmap Portscan
posted over 3 years ago

Recent comment

On: “Attachr.com: OpenID support added

You need to kill this spam stuff!

posted about 1 year ago by entropie

Look!

Latest links  RSS  

More...