Wilson Wilson
2014-Apr-30 15:59 UTC
How to create a search bar for searching youtube videos using youtube_it
I've been able to set things up to display a result of queries using youtube_it gem my current code for fetching that data is def index $client = YouTubeIt::Client.new(:dev_key => "AI39si6i1NPgrU35e6xxRgvtGclAdH9pHnwefuUbHKZmKJutqDNvTZwY3PawefEY9rarYzmpN__UuMH19bAny0-retoMa8IsNILlDA") @videos = $client.videos_by(:tags => ['funnyvideo']) end The thing is that I want to allow the user to input what they want to search instead of me putting in funny video, I want a search bar that allows users to type in their tags. My current search bar looks something like this <% form_tag videos_path, :method 'get' do %> <%= text_field_tag :search %> <%= submit_tag "search" %> <% end %> How can I pass in whatever the user type into the search bar to fetch the youtube tags? Thanks -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/68ba0c1234813047e18aa0192b5bec91%40ruby-forum.com. For more options, visit https://groups.google.com/d/optout.