# SVG showstopper

**URL:** <https://www.ruby-forum.com/t/svg-showstopper/55112>\
**Category:** Rails\
**Created:** [March 17, 2006, 1:48am UTC](https://www.ruby-forum.com/t/svg-showstopper/55112 "2006-03-17T01:48:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cc9497/32.png) [@jack](https://www.ruby-forum.com/u/jack)\
**Post date:** [March 17, 2006, 1:48am UTC](https://www.ruby-forum.com/t/svg-showstopper/55112/1 "2006-03-17T01:48:47Z")

</div>

We seem unable to get SVG running under Rails with apparent memory  
conflicts between the SVG xml object and parameters. For us, unless we  
can get SVG running okay under Rails, it is a showstopper for us to use  
Rails.

There seem to be only 2 examples out there for SVG, the graph project  
that actually converts SVG to another image format (way too  
cumbersome/unworkable for our needs) and the pinkjuice example that  
requires a separate cgi file creation (again seemingly too complex for  
our dynamically generated SVG diagrams). Is there any help out there?  
Are we missing something or must we abandon Rails for now? Thanks for  
any help.

---

<div class="post-metadata">

**Author:** ![jack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cc9497/32.png) [@jack](https://www.ruby-forum.com/u/jack)\
**Post date:** [March 17, 2006, 2:04am UTC](https://www.ruby-forum.com/t/svg-showstopper/55112/2 "2006-03-17T02:04:38Z")

</div>

Have you looked at this: [http://ruby-svg.sourceforge.jp/](http://ruby-svg.sourceforge.jp/)

Though the site is in Japanese, there’s an english language readme  
and a bunch of samples in the tarball.

–Casey

---

<div class="post-metadata">

**Author:** ![jack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cc9497/32.png) [@jack](https://www.ruby-forum.com/u/jack)\
**Post date:** [March 17, 2006, 9:06am UTC](https://www.ruby-forum.com/t/svg-showstopper/55112/3 "2006-03-17T09:06:42Z")

</div>

The SVG is handled client-side… I don’t see how it would make a  
difference if you’re  
using rails, php, or just serving it as a static file.

I remember you were trying to do it with the object/embed tag, right?  
So, given the same  
object/embed tag what is happening differently between serving it from a  
php site versus  
the rails site?

b

---

<div class="post-metadata">

**Author:** ![jack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cc9497/32.png) [@jack](https://www.ruby-forum.com/u/jack)\
**Post date:** [March 17, 2006, 10:04am UTC](https://www.ruby-forum.com/t/svg-showstopper/55112/4 "2006-03-17T10:04:42Z")

</div>

Just want to add my voice to Ben’s.

The problem you’re seeing is (almost certainly) nothing to do with  
Rails. SVG is just a bunch of XML text that gets sent to the client  
browser within a regular HTML page - it would be a huge surprise to me  
if you’d found a bug in Rails that prevented this from happening  
correctly.

If I get the chance tonight, I’ll have a play with it. If you’re  
using Firefox 1.5 to render the SVG, be aware that Firefox only works  
with a subset of SVG - it doesn’t support the whole SVG spec.

Good luck

Dave M.

---

<div class="post-metadata">

**Author:** ![jack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cc9497/32.png) [@jack](https://www.ruby-forum.com/u/jack)\
**Post date:** [March 18, 2006, 12:10am UTC](https://www.ruby-forum.com/t/svg-showstopper/55112/5 "2006-03-18T00:10:08Z")

</div>

I don’t understand Rails internals well enought but what runs fine under  
html or under php creates major conflicts under Rails. And I’ve yet to  
see any SVG examples running under Rails to indicate the problem is on  
our side.

Ben M. wrote:

> The SVG is handled client-side… I don’t see how it would make a  
> difference if you’re  
> using rails, php, or just serving it as a static file.
> 
> I remember you were trying to do it with the object/embed tag, right?  
> So, given the same  
> object/embed tag what is happening differently between serving it from a  
> php site versus  
> the rails site?
> 
> b

---

<div class="post-metadata">

**Author:** ![jack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cc9497/32.png) [@jack](https://www.ruby-forum.com/u/jack)\
**Post date:** [March 18, 2006, 12:31am UTC](https://www.ruby-forum.com/t/svg-showstopper/55112/6 "2006-03-18T00:31:39Z")

</div>

Still, rails should _not_ be doing anything with your static svg other  
than serving it.  
There must be some difference in the resulting html file or how it’s  
served between your  
various setups… Rails internals shouldn’t even enter into it… the  
svg is served  
directly by the server.

If you’re interested in making it work in rails, why not post complete  
examples of what  
you’re trying to do (code samples, platform info, server info, etc.). My  
memory of this  
thread is that you just keep saying “it doesn’t work” without saying  
what you’re trying to  
do or how.

Or, if you’re happy enough with PHP and it works with PHP, just stick  
with that.

b

---

<div class="post-metadata">

**Author:** ![jack](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cc9497/32.png) [@jack](https://www.ruby-forum.com/u/jack)\
**Post date:** [March 18, 2006, 8:38am UTC](https://www.ruby-forum.com/t/svg-showstopper/55112/7 "2006-03-18T08:38:55Z")

</div>

show some code…  
show how you are building the object tag, show the data for the svg

then we all see how we can make it work…

On Saturday, March 18, 2006, at 12:10 AM, jack wrote:

> > I remember you were trying to do it with the object/embed tag, right?
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

Mikkel B.

www.strongside.dk - Football Portal(DK)  
[nflfeed.helenius.org](http://nflfeed.helenius.org) - Football News(DK)  
ting.minline.dk - Buy Old Stuff!(DK)
