# Youtube pagination

**URL:** <https://www.ruby-forum.com/t/youtube-pagination/176798>\
**Category:** Rails\
**Created:** [October 6, 2009, 11:25am UTC](https://www.ruby-forum.com/t/youtube-pagination/176798 "2009-10-06T11:25:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/58956e/32.png) [@ravi](https://www.ruby-forum.com/u/ravi)\
**Post date:** [October 6, 2009, 11:25am UTC](https://www.ruby-forum.com/t/youtube-pagination/176798/1 "2009-10-06T11:25:47Z")

</div>

Hi  
I m able to get the videos from youtube using youtube-g ,now  
doing an pagination

for youtube videos for 4 pages

my controller code is

class VideosController \< ApplicationController  
def index  
client = YouTubeG::Client.new  
@videos=client.videos\_by(:query =\> “penguin”, :page =\>  
4, :per\_page =\> 2)  
end

end

view is

# Videos
\<% @videos.videos.each do |v| %\> \<%= v.title %\>

\<%= v.html\_content %\>

\<%= v.embed\_html %\> \<% end %\>

this is my code for getting videos from youtube,now facing problem in

pagination because in the query i mentioned 2 pages but i m getting

only one page and i have not added pagination code for it.can u help

me to code to include page option for four pages…

regards  
raghu
