将paginate不分页(我想是实例变量错误)

时间:2014-05-26 18:47:53

标签: ruby-on-rails will-paginate

那里,我无法让Will_paginate对用户拥有的照片进行分页。看看是否有人可以帮助我...

我的代码是:

用户控制器

def show
    @user = User.find(params[:id])
    @photos = @user.photos.paginate(:page => params[:page],:per_page => 6)
end

显示用户视图

<div class="row center semi_padding_top semi_padding_">
   <%= will_paginate(@photos,:next_label => "<button class='semi_margin_right mediumbutton large-1 columns large-centered'>Más<i class='big icon-arrow-right2'></i></button>", :previous_label => "<button class='semi_margin_left mediumbutton large-1 columns large-centered'><i class='big icon-arrow-left'></i>Menos</button>", :page_links => false) %>
    </div>

谢谢!

0 个答案:

没有答案