display_for 0.1.9 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.9
1
+ 0.1.10
data/display_for.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "display_for"
8
- s.version = "0.1.9"
8
+ s.version = "0.1.10"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Mateo Murphy"]
@@ -25,16 +25,25 @@ module DisplayFor
25
25
  end
26
26
 
27
27
  def to_s
28
- result = ''.html_safe
28
+ result = "\n".html_safe
29
29
 
30
30
  @collection.each do |resource|
31
31
  result << build_row(resource)
32
32
  end
33
33
 
34
+ if @footer
35
+ result << @footer.build_row(nil)
36
+ end
37
+
34
38
  html_options[:class] ||= "list #{@resource_class.to_s.underscore}-list"
35
39
  content_tag(:ul, result, html_options).html_safe
36
40
  end
37
41
 
42
+ def footer
43
+ @footer = List.new(resource_class, [], html_options, template)
44
+ yield @footer
45
+ end
46
+
38
47
  end
39
48
  end
40
49
  end
@@ -34,7 +34,7 @@ module DisplayFor
34
34
  end
35
35
 
36
36
  def to_s
37
- result = ''.html_safe
37
+ result = "\n".html_safe
38
38
 
39
39
  @collection.each do |resource|
40
40
  result << build_row(resource)
@@ -1,6 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
- LIST_OUTPUT = %q|<ul class="list test_model-list"><li id="test_model_1"><span>1</span><span>foo</span><span>bar</span></li>
3
+ LIST_OUTPUT = %q|<ul class="list test_model-list">
4
+ <li id="test_model_1"><span>1</span><span>foo</span><span>bar</span></li>
5
+ <li><span>&nbsp;</span></li>
4
6
  </ul>|
5
7
 
6
8
  module DisplayFor
@@ -12,6 +14,11 @@ module DisplayFor
12
14
  t.attribute :id
13
15
  t.attribute :first_name
14
16
  t.attribute :last_name
17
+ t.footer do |f|
18
+ f.html :form do
19
+ '&nbsp;'.html_safe
20
+ end
21
+ end
15
22
  end
16
23
  end
17
24
 
@@ -1,7 +1,8 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  TABLE_OUTPUT = %q|<table class="table table-bordered table-striped test_model-table"><thead><tr><th class="col_id">id</th><th class="col_first_name">first_name</th><th class="col_last_name">last_name</th></tr></thead>
4
- <tbody><tr id="test_model_1"><td>1</td><td>foo</td><td>bar</td></tr>
4
+ <tbody>
5
+ <tr id="test_model_1"><td>1</td><td>foo</td><td>bar</td></tr>
5
6
  </tbody><tfoot><tr><td colspan="3">&nbsp;</td></tr>
6
7
  </tfoot></table>|
7
8
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: display_for
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -159,7 +159,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
159
159
  version: '0'
160
160
  segments:
161
161
  - 0
162
- hash: -3990301534027286697
162
+ hash: 4109272304261322082
163
163
  required_rubygems_version: !ruby/object:Gem::Requirement
164
164
  none: false
165
165
  requirements: