From be2fa31b6faac106e55271ec95652492591432dd Mon Sep 17 00:00:00 2001 From: Seth Kingsley Date: Sun, 31 Jan 2016 05:16:15 -0800 Subject: [PATCH] =?UTF-8?q?Fix=20the=20=E2=80=9Cpager=E2=80=9D=20Bootstrap?= =?UTF-8?q?=20element=20style.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/bootstrap_pagination/bootstrap_renderer.rb | 5 +++-- spec/pagination_spec.rb | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/bootstrap_pagination/bootstrap_renderer.rb b/lib/bootstrap_pagination/bootstrap_renderer.rb index d578929..cf0ab40 100644 --- a/lib/bootstrap_pagination/bootstrap_renderer.rb +++ b/lib/bootstrap_pagination/bootstrap_renderer.rb @@ -50,7 +50,7 @@ def gap def previous_page num = @collection.current_page > 1 && @collection.current_page - 1 - previous_or_next_page(num, @options[:previous_label], "prev") + previous_or_next_page(num, @options[:previous_label], "previous") end def next_page @@ -59,7 +59,8 @@ def next_page end def ul_class - ["pagination", @options[:class]].compact.join(" ") + base_class = (@options[:page_links]) ? "pagination" : "pager" + [base_class, @options[:class]].compact.join(" ") end end end diff --git a/spec/pagination_spec.rb b/spec/pagination_spec.rb index 752b06b..be66650 100644 --- a/spec/pagination_spec.rb +++ b/spec/pagination_spec.rb @@ -114,7 +114,7 @@ def url(args) let(:link_options) { {"data-remote" => true} } it "includes the link attribute" do - html.at_css('li.prev a')["data-remote"].must_equal "true" + html.at_css('li.previous a')["data-remote"].must_equal "true" end end end