diff options
author | ThibG <thib@sitedethib.com> | 2019-01-13 10:23:54 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2019-01-13 09:23:54 +0000 |
commit | 4fb94c758e3bf2e1c0525e9075c2d5dedc14c666 (patch) | |
tree | c08ae8ba9144ece107fac0893ea055a7079edcd1 /app/helpers | |
parent | 9ee9cb549b58a33a81a9da318cbdc26ed2e47788 (diff) |
Add attachment list fallback to public pages (#9780)
* Add attachment list fallback to public pages Fixes #6714 * Refactor attachments lists
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 c33975cac..5097a0953 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 |