Hi,
I let users embed videos from Youtube, Google, Vimeo etc. I thought about the best and most secure approach (I don't want them to be able to include any flash and I also want to restrict the Videosites to exclude free porn websites etc.).
So I thought the best and easiest thing would be to let the user just copy&paste the URL of the video into a text-field, store it in a ExternalVideo Model and then just generate the needed HTML to embed the video.
So my ExternalVideo Model has a function called "embed_html" which should return the proper HTML.
Of course I could do something like this:
def embed_html
# just a very short example to make my point
"<embed src='#{@video_source}'>"
end
But I think that's bad practice and very unreadable.
My Question: Is there a tool / Gem / Built-in function I can use to generate custom HTML, something like the View Helpers (link_to, image_tag, etc)?
Thanks for your help!