Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 3: How do you style will_paginate links?

In coding layout is the link styled like

<a href="#" class="class1 class2 class3"><span>Previous</span></a>
<a href="#" class="class1 class2 class3"><span>Next</span>

I tried to search and I found some possible modifications of a shape of these two links. It's:

<div class="pag">
  <%= will_paginate @data, :page_links => false, :next_label => '' %> 
</div>

<div class="pag">
  <%= will_paginate @data, :page_links => false, :previous_label => '' %>
</div>

My question: How can I update the second example to the shape of the first example? My problem is those two span elements...

Thanks

like image 433
user1946705 Avatar asked Jan 18 '23 17:01

user1946705


1 Answers

It's can be very easy - just add html markup for your paginate components to your config/locales/en.yml file for example:

en:
  hello: "Hello world"
  will_paginate:
    previous_label: <span class="glyph glyph-prev"></span>
    next_label: <span class="glyph glyph-next"></span>

It's all!

like image 159
Sergio Belevskij Avatar answered Jan 21 '23 07:01

Sergio Belevskij