This project is archived and is in readonly mode.
Explicitly setting the content type get overriden by respond_to / render
-
Michael Koziarski
- Milestone cleared.
-
Michael Koziarski
- Milestone set to 2.x
-
CancelProfileIsBroken
- Tag changed from 2.2, 2.3 to 2.2, 2.3, bugmash
-
Pratik
Adding Jose to notifications as he has dabbled with this code recently.
-
José Valim
Sorry, but I don't think the content-type is being overwritten, it just does not accept symbols. So it's just converting a symbol to string (that's why you get "html" in the response).
Can you please try doing this:
render :text => content, :content_type => Mime::HTML.to_srender :text => content, :content_type => Mime::TEXT.to_s(it will probably work without .to_s also)
-
Michael Koziarski
It should probably accept all three, symbol, string and Mime::CONSTANT.
-
Felipe Talavera
I've been working and discussing with José Valim and finnally I came with a patch to force the symbol to be converted to Mime::Type in render method into ActiveControler::base class. The patch is for the 2-3-stable branch, because in the master all the controller works in another way.
I've attached a patch.
-
José Valim
Felipe, thanks for the patch. However, we have the same code in actioncontroller/streaming.rb, so would be desirable we refactor both into a single method.
-
José Valim
- Assigned user changed from Michael Koziarski to Yehuda Katz (wycats)
- State changed from new to incomplete
- Milestone cleared.
Assigning to Yehuda, he is the guy to handle it on both 2.3 and 3.0.
-
José Valim
- Tag changed from 2.2, 2.3, bugmash to 2.2, 2.3
-
Yehuda Katz (wycats)
- State changed from incomplete to resolved
-
Dave Myron
Was this fixed in 3.0.2? It appears that, with 3.0.3,
:content_type => :htmlstill sets the Content-Type to "html" instead of "text/html".
