Set Content-Type


/ Published in: Rails
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.