【问题标题】:Rails: Change next_page class of will_paginate gemRails:更改 will_paginate gem 的 next_page 类
【发布时间】:2017-11-11 07:42:34
【问题描述】:

是否可以更改将分页 gem 的类名“next_page”?例如很容易更改 .paginate 类,但我不知道是否可以使用 'next_page'

:class - CSS class name for the generated DIV (default: "pagination")
:previous_label - default: "« Previous"
:next_label - default: "Next »"
:page_links - when false, only previous/next links are rendered (default: true)
:inner_window - how many links are shown around the current page (default: 4)
:outer_window - how many links are around the first and the last page (default: 1)
:link_separator - string separator for page HTML elements (default: single space)
:param_name - parameter name for page number in URLs (default: :page)
:params - additional parameters when generating pagination links (eg.             :controller => "foo", :action => nil)
:renderer - class name, class or instance of a link renderer (default in Rails: WillPaginate::ActionView::LinkRenderer)
:container - toggles rendering of the DIV container for pagination links, set to false only when you are rendering your own pagination markup (default: true)

【问题讨论】:

  • 为什么要改类名?

标签: css ruby-on-rails ruby rubygems will-paginate


【解决方案1】:

一旦您被允许更改封闭类名,更改嵌套类名是多余的,因此不提供。

使用 CSS 选择器 .pagination > .next_page 以避免任何可能的名称冲突。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-28
    • 1970-01-01
    • 1970-01-01
    • 2017-06-02
    • 2012-11-27
    • 1970-01-01
    相关资源
    最近更新 更多