simple_model_view 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +2 -0
- data/lib/simple_model_view/builder_helpers.rb +4 -1
- data/lib/simple_model_view/template_helpers.rb +1 -1
- data/lib/simple_model_view/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4b832cc0f2224c2912daf65fa7376b2a9f42e7335ce98ff9da0d97f1d9e2ee5
|
4
|
+
data.tar.gz: 04d5692291d958a2650f1a182d3a4e9e2b2d5963b0622b387e88aee80bb712f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5216e91596e617b8f22ee3e89692180ac823687db753906ceb95ae5d1e500c03468a09df71d5b5c646c5018f1573b2b904a2c819cbc3b149be601299c9403f69
|
7
|
+
data.tar.gz: 9ee99c2fb1a631080173bcb3ecb2d4adfc706f1c91e681d6d207c8a0dce1eafb49a7b10f500cfb38303519f7d6881d6991ce3093e35b83aaeb61e8f7caab586a
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -95,6 +95,8 @@ Renders model attributes table using simple helpers.
|
|
95
95
|
|
96
96
|
`<%= t.row :price, format: '%.2f' %>`
|
97
97
|
|
98
|
+
* `no_blank_block` if `true` it will render blank span instead of block for `nil` value
|
99
|
+
|
98
100
|
### Options for `row`
|
99
101
|
|
100
102
|
* `label_html` is a hash of html attributes to be added to label (th tag)
|
@@ -110,7 +110,10 @@ module SimpleModelView # rubocop:disable
|
|
110
110
|
end
|
111
111
|
|
112
112
|
def format_value_or_block(value, type, **options, &block)
|
113
|
-
|
113
|
+
if block
|
114
|
+
return blank_span if value.nil? && options[:no_blank_block]
|
115
|
+
return yield value
|
116
|
+
end
|
114
117
|
return blank_span if value.nil?
|
115
118
|
|
116
119
|
format value, type, **options
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_model_view
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuriy Esaulov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionview
|