Content-type on render :file


#1

Hi all,

I’ve just been trying out the dirt-simple rcss scheme posted here:
http://blog.hasmanythrough.com/articles/2006/03/23/dirt-simple-rcss-templates

It looks like the content-type declaration on the line:
render :file => file_name, :content_type => ‘text/css’
isn’t getting honoured. I had to add a separate:
@headers[‘Content-type’] => ‘text/css’
for it not to be received as text/html. Is this a known problem, or did
I screw something up? I’ve got an app that was developed on 1.0, but
I’ve upgraded to 1.1.2 on the host machine.

Any ideas?


#2

Alex Y. wrote:

I’ve just been trying out the dirt-simple rcss scheme posted here:
http://blog.hasmanythrough.com/articles/2006/03/23/dirt-simple-rcss-templates

It looks like the content-type declaration on the line:
render :file => file_name, :content_type => ‘text/css’
isn’t getting honoured. I had to add a separate:
@headers[‘Content-type’] => ‘text/css’
for it not to be received as text/html. Is this a known problem, or did
I screw something up? I’ve got an app that was developed on 1.0, but
I’ve upgraded to 1.1.2 on the host machine.

Hi Alex, I posted a response on my blog to your comment. The
:content_type option is working fine for me on Rails 1.1.2 (edge).


Josh S.
http://blog.hasmanythrough.com


#3

Josh S. wrote:

I screw something up? I’ve got an app that was developed on 1.0, but
I’ve upgraded to 1.1.2 on the host machine.

Hi Alex, I posted a response on my blog to your comment. The
:content_type option is working fine for me on Rails 1.1.2 (edge).
Interesting… Is that on an app created as Rails 1.1.2, or one
upgraded from Rails 1.0? I’ve got no idea what the difference could be,
but that’s the only thing I’ve done that seems likely to cause
weirdness.