table_helpers 0.3 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -10,7 +10,7 @@ Examples
10
10
  <%= t.headers ['First column', 'Second column'] %>
11
11
  <%= t.tr do |tr| %>
12
12
  <%= tr.td 'Example 1' %>
13
- <%= tr.td 'Example 2' %>
13
+ <%= tr.td 'Example 2', :class => 'options' %>
14
14
  <% end %>
15
15
  <% end %>
16
16
 
@@ -23,7 +23,7 @@ HTML output:
23
23
  </tr>
24
24
  <tr>
25
25
  <td>Example 1</td>
26
- <td>Example 2</td>
26
+ <td class="options">Example 2</td>
27
27
  </tr>
28
28
  </table>
29
29
 
data/lib/table_list.rb CHANGED
@@ -15,8 +15,8 @@ class TableList
15
15
  end
16
16
  end
17
17
 
18
- def td(data)
19
- @instance.content_tag :td, data
18
+ def td(data, options={})
19
+ @instance.content_tag :td, data, :class => options[:class]# unless options[:class].blank?
20
20
  end
21
21
 
22
22
  def tr(&block)
@@ -14,11 +14,11 @@ class TableHelpersTest < ActionView::TestCase
14
14
  t.headers(['Column 1', 'Column 2']) +
15
15
  t.tr do |tr|
16
16
  tr.td('Example 1') +
17
- tr.td('Example 2')
17
+ tr.td('Example 2', :class => 'options')
18
18
  end +
19
19
  t.tr do |tr|
20
20
  tr.td('Example 3') +
21
- tr.td('Example 4')
21
+ tr.td('Example 4', :class => 'options')
22
22
  end
23
23
  end
24
24
 
@@ -30,11 +30,11 @@ class TableHelpersTest < ActionView::TestCase
30
30
  </tr>
31
31
  <tr>
32
32
  <td>Example 1</td>
33
- <td>Example 2</td>
33
+ <td class="options">Example 2</td>
34
34
  </tr>
35
35
  <tr>
36
36
  <td>Example 3</td>
37
- <td>Example 4</td>
37
+ <td class="options">Example 4</td>
38
38
  </tr>
39
39
  </table>
40
40
  EOF
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: table_helpers
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 3
9
- version: "0.3"
8
+ - 4
9
+ version: "0.4"
10
10
  platform: ruby
11
11
  authors:
12
12
  - "Damian Ba\xC4\x87kowski"
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-06-16 00:00:00 +02:00
17
+ date: 2011-08-10 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies: []
20
20