mod_ruby Setting Content-Type in rhtml files

B

Ben Gribaudo

Howdy!

I feel like I am missing something simple here. I would like to set the
HTTP content-type header from an rhtml file. I've tried different
approaches with the same result--I always receive the default
("text/html ...") instead of the specified header. What am I doing wrong?

This code:
<%
require "cgi"

cgi = CGI.new
cgi.header("type"=>"text/plain")
puts "test"
%>
returns a content type header of "text/html; charset=iso-8859-1" instead
of "text/plain".

Thank you,
Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top