ajax - Rails .js render html in modal -


i'm passing following parameter modal:

"<iframe width="350" height="197" src="http://www.youtube.com/embed/jsexp2ebb4s?feature=oembed" frameborder="0" allowfullscreen></iframe>" 

then, try render dynamically in modal...in show.js....

$("#modalpostvid").html("params[:vid]")

but loads text (i.e. loads string) instead of embedded video.

how can make video embeds?

thank you.

try

$("#modalpostvid").html("<%= escape_javascript params[:vid].html_safe %>") 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -