will_paginate-bootstrap 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,13 +22,18 @@ module BootstrapPagination
22
22
  end
23
23
  end
24
24
 
25
+ def container_attributes
26
+ super.except(*[:link_options])
27
+ end
28
+
25
29
  protected
26
30
 
27
31
  def page_number(page)
32
+ link_options = @options[:link_options] || {}
28
33
  if page == current_page
29
34
  tag("li", tag("span", page), class: "active")
30
35
  else
31
- tag("li", link(page, page, :rel => rel_value(page)))
36
+ tag("li", link(page, page, link_options.merge(rel: rel_value(page))))
32
37
  end
33
38
  end
34
39
 
@@ -47,8 +52,9 @@ module BootstrapPagination
47
52
  end
48
53
 
49
54
  def previous_or_next_page(page, text, classname)
55
+ link_options = @options[:link_options] || {}
50
56
  if page
51
- tag("li", link(text, page), class: classname)
57
+ tag("li", link(text, page, link_options), class: classname)
52
58
  else
53
59
  tag("li", tag("span", text), class: "%s disabled" % classname)
54
60
  end
@@ -1,3 +1,3 @@
1
1
  module BootstrapPagination
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
@@ -25,11 +25,12 @@ describe "Bootstrap Renderer" do
25
25
  let(:page) { (collection_size / 2.0).to_i }
26
26
  let(:collection) { 1.upto(collection_size).to_a }
27
27
  let(:version) { nil }
28
+ let(:link_options) { nil}
28
29
 
29
30
  let(:output) do
30
31
  will_paginate(
31
32
  collection.paginate(:page => page, :per_page => 1),
32
- renderer: MockRenderer, bootstrap: version
33
+ renderer: MockRenderer, bootstrap: version, link_options: link_options
33
34
  )
34
35
  end
35
36
 
@@ -92,4 +93,12 @@ describe "Bootstrap Renderer" do
92
93
  html.at_css('ul.pagination').wont_be_nil
93
94
  end
94
95
  end
96
+
97
+ describe "with link attribute specified" do
98
+ let(:link_options) { {"data-remote" => true} }
99
+
100
+ it "includes the link attribute" do
101
+ html.at_css('li.prev a')["data-remote"].must_equal "true"
102
+ end
103
+ end
95
104
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: will_paginate-bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-10 00:00:00.000000000 Z
12
+ date: 2013-09-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: will_paginate
@@ -64,7 +64,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
64
64
  version: '0'
65
65
  segments:
66
66
  - 0
67
- hash: 719611630819413183
67
+ hash: -2778479780677387390
68
68
  required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  none: false
70
70
  requirements:
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  version: '0'
74
74
  segments:
75
75
  - 0
76
- hash: 719611630819413183
76
+ hash: -2778479780677387390
77
77
  requirements: []
78
78
  rubyforge_project: will_paginate-bootstrap
79
79
  rubygems_version: 1.8.23