diff options
author | pluralcafe-docker <git@plural.cafe> | 2019-01-16 19:42:22 +0000 |
---|---|---|
committer | pluralcafe-docker <git@plural.cafe> | 2019-01-16 19:42:22 +0000 |
commit | fb7ec403227690f897a9a693f2461b94bf7e2582 (patch) | |
tree | 043d220748575a444b8628d8c4bf2e5225a92a00 /app/helpers | |
parent | ae24ef877b82466cab026a76ea6ed8598ddaae18 (diff) | |
parent | 530d29148ca0c5bf29f6fa516b1ef4f91d95894b (diff) |
Merge branch 'glitch'
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/application_helper.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5e7fdffb0..fc006d777 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -69,8 +69,12 @@ module ApplicationHelper tag(:meta, content: content, property: property) end - def react_component(name, props = {}) - content_tag(:div, nil, data: { component: name.to_s.camelcase, props: Oj.dump(props) }) + def react_component(name, props = {}, &block) + if block.nil? + content_tag(:div, nil, data: { component: name.to_s.camelcase, props: Oj.dump(props) }) + else + content_tag(:div, data: { component: name.to_s.camelcase, props: Oj.dump(props) }, &block) + end end def body_classes |