psu-libraries/psulib_blacklight

View on GitHub
app/components/browse/page_size_selector.html.erb

Summary

Maintainability
Test Coverage
<div class="dropdown">
  <button
    class="btn btn-outline-secondary dropdown-toggle"
    type="button"
    id="page-size-btn"
    data-toggle="dropdown"
    aria-haspopup="true"
    aria-expanded="false">
    <%= params[:length] || 20 %> per page
  </button>
  <div class="dropdown-menu" aria-labelledby="page-size-btn">
    <%= link_to '10',
                link_path(10),
                class: 'dropdown-item' %>
    <%= link_to '20',
                link_path(20),
                class: 'dropdown-item' %>
    <%= link_to '50',
                link_path(50),
                class: 'dropdown-item' %>
  </div>
</div>