diff options
author | Thibaut Girka <thib@sitedethib.com> | 2019-01-13 14:41:06 +0100 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2019-01-13 14:41:06 +0100 |
commit | eff1c94744609b432c8dba8a35cd97e9a20ce652 (patch) | |
tree | e173621ead4c940b201d419971c291530d575103 /app/helpers | |
parent | 2cfa55185a5fc7d93a160a4e9a4730aae6725b0f (diff) | |
parent | 4fb94c758e3bf2e1c0525e9075c2d5dedc14c666 (diff) |
Merge branch 'master' into glitch-soc/merge-upstream
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 |