I wanted to use inline SVG in a rails app. Two steps were needed to enable this:
-
Set content type to application/xhtml+xml. I enabled this globally by adding this to application_controller.rb
before_filter{ response.content_type = 'application/xhtml+xml' }
-
Indicate we're using XHTML in the <html> tag. I enabled this globally in application.html.erb: