Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby gems Will_Paginate styling

Using the Will_paginate gem for a ruby on rails app, I'm not using Bootstrap though. How do I go about styling the page buttons? I'm at a loss here. Thinking maybe will_paginate @posts do? or what o.o and by styling, I'm talking about CSS in just in case.

like image 444
CoderDude Avatar asked Jan 26 '23 00:01

CoderDude


1 Answers

you can use this css (without bootstrap)

.digg_pagination {
  background: white;
  cursor: default;
  /* self-clearing method: */ }
  .digg_pagination a, .digg_pagination span, .digg_pagination em {
    padding: 0.2em 0.5em;
    display: block;
    float: left;
    margin-right: 1px; }
  .digg_pagination .disabled {
    color: #999999;
    border: 1px solid #dddddd; }
  .digg_pagination .current {
    font-style: normal;
    font-weight: bold;
    background: #2e6ab1;
    color: white;
    border: 1px solid #2e6ab1; }
  .digg_pagination a {
    text-decoration: none;
    color: #105cb6;
    border: 1px solid #9aafe5; }
    .digg_pagination a:hover, .digg_pagination a:focus {
      color: #000033;
      border-color: #000033; }
  .digg_pagination .page_info {
    background: #2e6ab1;
    color: white;
    padding: 0.4em 0.6em;
    width: 22em;
    margin-bottom: 0.3em;
    text-align: center; }
    .digg_pagination .page_info b {
      color: #000033;
      background: #6aa6ed;
      padding: 0.1em 0.25em; }
  .digg_pagination:after {
    content: ".";
    display: block;
    height: 0;
    clear: both;
    visibility: hidden; }
  * html .digg_pagination {
    height: 1%; }
  *:first-child + html .digg_pagination {
    overflow: hidden; 
}

and add css class this inside your erb like sample below

<% if @news.any? %>
  <%= render @news %>
  <div class="digg_pagination">
    <%= will_paginate %>
  </div>
<% end %>
like image 50
widjajayd Avatar answered Jan 29 '23 08:01

widjajayd