Forum: Ruby on Rails Content-type on render :file

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Alex Y. (Guest)
on 2006-04-14 00:55
(Received via mailing list)
Hi all,

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

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?
Josh S. (Guest)
on 2006-04-14 02:32
Alex Y. wrote:
> I've just been trying out the dirt-simple rcss scheme posted here:
> http://blog.hasmanythrough.com/articles/2006/03/23...
>
> 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
Alex Y. (Guest)
on 2006-04-14 11:29
(Received via mailing list)
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.
This topic is locked and can not be replied to.