问题
Here's the vimeo url code.
<object width="40" height="300"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=9082619&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=9082619&server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="40" height="300"></embed></object><p><a href="http://vimeo.com/9082619">Queueing - One in a Dozen</a> from <a href="http://vimeo.com/enki">sideshow bob</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
Here's the example from the Rails docs
<%= sanitize @app.description,
:tags => %w(table tr td),
:attributes => %w(id class styles) %>
I want to just show the video, no height, width, title etc. I tried modifying it for the past 20 mins, but couldn't get it to work.
Any suggestions?
回答1:
It's not clear from your question what exactly you're trying to do, but try:
<%= sanitize @app.description,
:tags => %w(a embed object p param),
:attributes => %w(allowfullscreen allowscriptaccess href name src type value) %>
来源:https://stackoverflow.com/questions/2189497/sanitize-vimeo-embed-code