Hello, I’m trying to insert inline SVG in my XHTML pages but I realized that rails serves XHTML pages with content-type header set to “text/html; charset=utf-8”. It’s definitely not cool and it should be “application/xhtml+xml, charset=utf-8”. So I’ve added a mime type line in initializer : Mime::Type.register “application/xhtml+xml”, :xhtml I also modified my controllers to use xhtml mime type. respond_to do |format| format.xhtml # index.xhtml.erb format.xml { render :xml => @users } endAnd finally rename my views *.html.erb became *.xhtml.erb.
This modifications works well but i have a few questions :
1 - Is there a more straightforward / elegant solution ?
2 - How can I handle browsers that don’t understand application/xhtml+xml content type ?
Thanks in advance
Titinux.