Skip to content

Instantly share code, notes, and snippets.

@elsapet
Created September 19, 2013 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elsapet/6624188 to your computer and use it in GitHub Desktop.
Save elsapet/6624188 to your computer and use it in GitHub Desktop.
# home_controller.rb
if request.xhr?
search = params[:search]
numberYouTube = '10'
@youtube_url = 'http://gdata.youtube.com/feeds/api/videos?q='+search.inspect+'&format=5&max- results='+numberYouTube+'&v=2&alt=jsonc'
render "search", layout: false
else
render :index
end
# search.html.erb
<div id="youtube_url"><%= @youtube_url %></div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment