diff options
author | ThibG <thib@sitedethib.com> | 2019-01-14 11:48:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-14 11:48:36 +0100 |
commit | 077639c27409f897e87522dd18a51801b6cbc40d (patch) | |
tree | a70b542e4bb88ed78d221765b5a675de0e323626 /app/helpers/application_helper.rb | |
parent | 2cfa55185a5fc7d93a160a4e9a4730aae6725b0f (diff) | |
parent | 4cec7a77c37e23117323a4ed8f609939ab50b4d6 (diff) |
Merge pull request #886 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'app/helpers/application_helper.rb')
-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 |