lml / sketchily

Embed SVG-edit in Rails HTML forms
MIT License
26 stars 9 forks source link

Accept url #4

Closed ramontayag closed 11 years ago

ramontayag commented 11 years ago

Can specify URL as a parameter:

// Local URL:
?url=images/logo.svg
Dantemss commented 11 years ago

Isn't the svg from the url completely overwritten when I do setSvgString() in the javascript?

ramontayag commented 11 years ago

I'm not sure what the priority is, but I'd guess setSvgString() would overwrite whatever has been set in url.

Dantemss commented 11 years ago

That's my problem with this though. Since this gem is designed to be used in forms, I pretty much always do setSvgString(). I guess I'll do some tests to see if the url would ever work.

ramontayag commented 11 years ago

Do you just put the js in the page yourself? Or is there an option with this gem where you get set the svg string?

Dantemss commented 11 years ago

The gem will always do setSvgString() although sometimes the string is empty. Maybe we can make the url option work in that case. Pretty much what will happen is that if you use f.sketchily field_name, then the gem will do setSvgString("<%= f_object.field_name %>"); as the page loads