table_helpers 0.4 → 0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/table_data.rb +7 -2
  2. data/lib/table_list.rb +1 -1
  3. metadata +5 -7
data/lib/table_data.rb CHANGED
@@ -7,6 +7,9 @@ class TableData < ActionView::Base
7
7
  end
8
8
 
9
9
  def row(label, data, colspan=false)
10
+ data = data.to_s.html_safe
11
+ label = label.to_s.html_safe
12
+
10
13
  unless @set_label_size && @label_size
11
14
  unless colspan
12
15
  result = content_tag :tr do
@@ -33,11 +36,13 @@ class TableData < ActionView::Base
33
36
  end
34
37
  end
35
38
 
36
- return result
39
+ result
37
40
  end
38
41
 
39
42
  def section(name=nil)
40
- unless name.nil?
43
+ name = name.to_s.html_safe
44
+
45
+ if name.present?
41
46
  content_tag :tr do
42
47
  content_tag :td, content_tag(:div, name, :class => "section"), :colspan => 2
43
48
  end
data/lib/table_list.rb CHANGED
@@ -16,7 +16,7 @@ class TableList
16
16
  end
17
17
 
18
18
  def td(data, options={})
19
- @instance.content_tag :td, data, :class => options[:class]# unless options[:class].blank?
19
+ @instance.content_tag :td, data.to_s.html_safe, :class => options[:class]# unless options[:class].blank?
20
20
  end
21
21
 
22
22
  def tr(&block)
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: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 4
9
- version: "0.4"
8
+ - 5
9
+ version: "0.5"
10
10
  platform: ruby
11
11
  authors:
12
12
  - "Damian Ba\xC4\x87kowski"
@@ -14,8 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-08-10 00:00:00 +02:00
18
- default_executable:
17
+ date: 2012-02-17 00:00:00 Z
19
18
  dependencies: []
20
19
 
21
20
  description: The table_helpers library provides a simple helpers to create table lists with headers and presenting data in tables.
@@ -36,7 +35,6 @@ files:
36
35
  - test/table_helpers_test.rb
37
36
  - test/test_helper.rb
38
37
  - README
39
- has_rdoc: true
40
38
  homepage: https://github.com/paki-paki/table_helpers
41
39
  licenses: []
42
40
 
@@ -66,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
64
  requirements: []
67
65
 
68
66
  rubyforge_project:
69
- rubygems_version: 1.6.2
67
+ rubygems_version: 1.8.10
70
68
  signing_key:
71
69
  specification_version: 3
72
70
  summary: Table helpers for Rails 3.0.x