Jeremy Kemper
12/3/2004 5:32:00 PM
Williams, Chris wrote:
> Well, after some googling I found a suitable hack to embed the SVG.
This might help.
In public/.htaccess:
# Strip .svg extension to mollify IE (put above other rules)
RewriteRule ^(.*)\.svg$ $1
In app/controllers/foo_controller.rb:
class FooController < AbstractApplicationController
def index; end
def chart
send_data generate_svg_chart, :type => 'image/svg+xml'
end
end
In app/views/foo/index.rhtml:
<object type="image/svg+xml" data="<%= url_for :action => 'chart'
%>.svg" width="800" height="600"></object>
Best,
jeremy