Kombo
Kombo

Reputation: 2381

Rails 3 - will_paginate hide class "next_page disabled" and "previous_page disabled"

I'm trying to make it so the next and previous page links do not display with the will_paginate gem if there are no more pages they can link to.

will_paginate assigns a special class to the span "next_page disabled" rather than the simple next_page if there is nothing to link to.

I tried just not displaying it with CSS:

.next_page disabled {
display: none;
}

and tried with %20:

.next_page%20disabled {

Anyway, does anyone know of a simple with to disable these links if they don't do anything?

Thanks

Upvotes: 1

Views: 1359

Answers (2)

Ola Tuvesson
Ola Tuvesson

Reputation: 5201

If you want to target an object with two classes (and only when both classes are present) you should use:

.next_page.disabled {
display: none;
}

Multiple classes are simply joined with a full stop.

HTH

Upvotes: 3

Steve Hill
Steve Hill

Reputation: 2321

Try .next_page.disabled - or even just .disabled - that should work. You can specify multiple classes for a single element, and that's what you're seeing here.

Upvotes: 3

Related Questions