I have a app/helpers/application_helper.rb file with this code:
def clippy(text, bgcolor = "#ffffff")
text.gsub!('"',"'")
path_to_swf = "/flash/clippy/clippy.swf"
html = <<-EOF
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
width="110"
height="14"
id="clippy" >
<param name="movie" value="#{path_to_swf}"/>
<param name="allowScriptAccess" value="always" />
<param name="quality" value="high" />
<param name="scale" value="noscale" />
<param NAME="FlashVars" value="text=#{text}">
<param name="bgcolor" value="#{bgcolor}">
<embed src="#{path_to_swf}"
width="110"
height="14"
name="clippy"
quality="high"
allowScriptAccess="always"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer"
FlashVars="text=#{text}"
bgcolor="#{bgcolor}"
/>
</object>
EOF
raw(html)
end
and I am trying to use it in an HTML file (I use HAML so it is really a HAML file) but I am not sure what I need to do in order to actually call that code above and render the little clippy widget.
I have this HAML code to try to render the clippy:
.clippy-container=clippy("hello","#ffffff")
and I do that in a file located in app/views/my_file.html.haml
Any idea what I need to do in order to make the clippy render?
Thanks!
Isn’t there a problem with
Shouldn’t it be
I tried your code, it works fine!