Created
October 10, 2010 03:28
-
-
Save anonymous/618906 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
search.html.erb | |
<%= form_tag(:action => "search") do %> | |
<%= label_tag(:q, "Search for:") %> | |
<%= text_field_tag(:wth) %> | |
<%= submit_tag("Search") %> | |
<% end %> | |
-- | |
youtube_controller.rb | |
require 'youtube_g' | |
class YoutubeController < ApplicationController | |
def index | |
end | |
def search | |
client = YouTubeG::Client.new | |
@videos = client.videos_by(:query => params[:wth],:per_page => 1) | |
render :action => :index | |
end | |
end | |
-- | |
index.html.rb | |
<%= @videos.inspect %> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment