开发者

how can i hide previous label in will_paginate

开发者 https://www.devze.com 2023-02-07 22:46 出处:网络
I can hide page links but i can\'t hide previous label. Any idea? Thanks. <%= will_paginate @posts, :page_links => false 开发者_C百科%>

I can hide page links but i can't hide previous label. Any idea? Thanks.

<%= will_paginate @posts, :page_links => false 开发者_C百科%>


While it looks like you can set the label using :previous_label, I don't think you can disable it.

A workaround would be to add a CSS rule to not display the previous link.

span.prev_page, a.prev_page {
  display: none;
}


Since you cannot disable the previous label, the best workaround is to use the following:

<%= will_paginate @posts, :page_links => false, :previous_label => '' %>
0

精彩评论

暂无评论...
验证码 换一张
取 消