3 ms·
Because the media types are parsed and used to select layout templates (layout.html.erb vs layout.xml.erb, etc).
by tptacek 8y ago
Because the media types are parsed and used to select layout templates (layout.html.erb vs layout.xml.erb, etc).
- anitil 8y agoAaaah Thankyou!
- Something1234 8y agoSo why wouldn't we just have a mapping between mime-types and extensions for look ups? Why bother examining the accept header beyond splitting and searching within the list? Like in such a way that we're opening arbitrary files with it?
- tptacek 8y agoThat's essentially what the patch does; the "symbol" call only resolves for known-good mime types.
- Something1234 8y agoWhere would this code be in the rails code base? I usually don't touch ruby. I'm mildly curious what was there originally.
- tptacek 8y agoIn the template resolver in ActionView. It's spread over multiple files and a bit hard to follow, which no doubt contributed to the problem.
- lostapathy 8y agoUnfortunately a lot of rails internals are like this :(.