Posted By

chrisamini on 10/04/09


rails ruby on mime content-type

Versions (?)

Set Content-Type

 / Published in: Rails

Put the following in your controller to define the content-type for that specific controller.

  1. class SampleController < ApplicationController
  2. def index
  3. headers["Content-Type"] = "text/html" # Use "text/xml" for XML files and so forth.
  4. end
  5. end

Report this snippet  

You need to login to post a comment.