lifeform 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/lifeform/form.rb +4 -2
- data/lib/lifeform/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9dbdb103263edf279b32445d6faa8d4b0cbb6cacf21fe7b8f520af8a5896d0e0
|
4
|
+
data.tar.gz: 01fe12ea7c14e7b488ea1a383e7158c8d63adce6346a4c869613419046d5ec58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7272ba2e8224d31ed4b8313bec9056dcef6f82c995119ca43f8381d55aa304eff8119e1055bc7a838a17b61225efdb09200485d79edf30d4c5c616551f52a453
|
7
|
+
data.tar.gz: 788fe1a1ec8ea8d70d10b7e90f3993443a2f71040dc68e547095c07c3688d9afd41b16afe1c33456a63dffe8273a2fc2f833c87201b10553c1d5cede1d8b5842
|
data/Gemfile.lock
CHANGED
data/lib/lifeform/form.rb
CHANGED
@@ -6,7 +6,7 @@ module Lifeform
|
|
6
6
|
FieldDefinition = Struct.new(:type, :library, :parameters)
|
7
7
|
|
8
8
|
# A form object which stores field definitions and can be rendered as a component
|
9
|
-
class Form
|
9
|
+
class Form # rubocop:todo Metrics/ClassLength
|
10
10
|
MODEL_PATH_HELPER = :polymorphic_path
|
11
11
|
|
12
12
|
class << self
|
@@ -134,7 +134,9 @@ module Lifeform
|
|
134
134
|
content = if block
|
135
135
|
view_context.capture(self, &block)
|
136
136
|
else
|
137
|
-
self.class.fields.map { |k, _v| field(k).render_in(self) }.join
|
137
|
+
self.class.fields.map { |k, _v| field(k).render_in(self) }.join.then do |renderings|
|
138
|
+
renderings.respond_to?(:html_safe) ? renderings.html_safe : renderings
|
139
|
+
end
|
138
140
|
end
|
139
141
|
|
140
142
|
return content unless emit_form_tag
|
data/lib/lifeform/version.rb
CHANGED