Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Nearly gave up until I found "<a href="http://asciicasts.com/episodes/254-pagination-with-kaminari" rel="nofollow">Pagination with Kaminari</a>".</p> <p>In short, after <code>rails g kaminari:default</code> go into the views that are created under app/views/kaminari and change the tags to suit your styling. </p> <p>I went into <code>_paginator.html.erb</code> and changed the <code>&lt;nav&gt;</code> to a <code>&lt;div&gt;</code> and replaced all the <code>&lt;span&gt;</code> tags with <code>&lt;li&gt;</code>. </p> <p>To get the bootstrap styling that fits my app, I changed the <code>&lt;div&gt;</code> tag in <code>_paginator.html.erb</code> to <code>&lt;div class="pagination pull-right"&gt;</code> and the <code>&lt;span class="page"&gt;</code> tags to simple <code>&lt;li&gt;</code>.</p> <p>There's are a couple of gotcha's that perhaps someone else can help with: </p> <ol> <li><p>There's erb in <code>_page.html.erb</code> that changes the class for the current page when active. It messes up the alignment so to get around that, change the <code>&lt;%= link_to_unless page.current? ... %&gt;</code> to <code>&lt;%= link_to page ... %&gt;</code>.</p></li> <li><p>The <code>_gap.html.erb</code> view which inserts the "..." block also gets messed up. Replace it with <code>&lt;li&gt;&lt;%= link_to '...' %&gt;&lt;/li&gt;</code> to get it to sit nicely inline. </p></li> </ol> <p>I just started coding 8 weeks ago so for sure there are better ways to approach this and ways to clean up 1 and 2, but if you just want things to look right and function as intended, give that a shot and fine tune later. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload