Question: I am pretty new to rails so this may be an easy question, but I was looking to create a Rails app that would use youtube in it. I have found that youtube\_it seems to be the gem of choice for a task like this but I am having trouble using it. Basically, I want to use the gem so that I can get videos from specific users, i.e. Stanford University and create a list of those videos with links to another page that has the video information and player. To test this out I tried the follow code:

application\_controller.rb

```
  class ApplicationController < ActionController::Base
  protect_from_forgery
  helper_method :yt_client

  private
    def yt_client
      @yt_client ||= YouTubeIt::Client.new(:dev_key => dev_key)
    end
  end

```

home\_controller.rb

```
class HomeController < ApplicationController
  def index
    @playlists = yt_client.playlists('stanforduniversity')
  end
end

```

index.html.erb

```
<h3>Home</h3>
<% @playlists.each do |playlist| %>
    <p>Playlist: <%= playlist %></p>
<% end %>

```

The problem with this is all I get for output on my home page is a list of something like this: #

My questions then are: is there a way to change this output into an actual title? Am I doing something wrong/forgetting a step? Or should I just use python code to use the Google API and put all the videos into my database(I already have some code for this) and just access it using my rails app?

Hope this is clear enough.

Answer: 
it looks like what you want to print out is the name of the playlist - but that is an attribute of the playlist object, so you'll need something like:

```
<% @playlists.each do |playlist| %>
  <p>Playlist: <%= playlist.title %></p>
<% end %>

```

otherwise ruby is trying to "print" the playlist object - which just doesn't work the way you expect.

Note: I've not used this gem either, I'm gathering this info from the gem docs here: <https://github.com/kylejginavan/youtube_it>
you have a complete demo that I made here

<http://youtube-it.heroku.com/>

included source!