simple_show 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -63,7 +63,8 @@ module SimpleShow
63
63
  end
64
64
  end
65
65
 
66
- @binding.content_tag(SimpleShow.value_tag, :class => SimpleShow.value_class) do
66
+ field_type = @record.class.columns_hash[attr.to_s].instance_variable_get(:@type)
67
+ @binding.content_tag(SimpleShow.value_tag, :class => [SimpleShow.value_class, field_type].compact) do
67
68
  [SimpleShow.value_prefix, value, SimpleShow.value_suffix].compact.join.html_safe
68
69
  end
69
70
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleShow
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
@@ -26,6 +26,11 @@ class SimpleShowValueTest < SimpleShowTestCase
26
26
  end
27
27
  )
28
28
  end
29
+ test 'css class for data types' do
30
+ assert @doc.css('span.value')[0].attr('class').split(/\s+/).include?('string') # :name
31
+ assert @doc.css('span.value')[6].attr('class').split(/\s+/).include?('decimal') # :handicap
32
+ assert @doc.css('span.value')[3].attr('class').split(/\s+/).include?('date') # :born_on
33
+ end
29
34
 
30
35
  test 'values and value overrides' do
31
36
  assert_equal 'Philip Hallstrom', @doc.css('span.value')[0].text
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_show
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 8
10
- version: 0.0.8
9
+ - 9
10
+ version: 0.0.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Philip Hallstrom
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-22 00:00:00 Z
18
+ date: 2011-10-30 00:00:00 Z
19
19
  dependencies: []
20
20
 
21
21
  description: "SimpleShow is to #show what SimpleForm is to #edit"
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  requirements: []
77
77
 
78
78
  rubyforge_project: simple_show
79
- rubygems_version: 1.8.6
79
+ rubygems_version: 1.8.10
80
80
  signing_key:
81
81
  specification_version: 3
82
82
  summary: "SimpleShow is to #show what SimpleForm is to #edit"