0
0
Fork 0

Add attachment list fallback to public pages (#9780)

* Add attachment list fallback to public pages

Fixes #6714

* Refactor attachments lists
This commit is contained in:
ThibG 2019-01-13 10:23:54 +01:00 committed by Eugen Rochko
parent 9ee9cb549b
commit 4fb94c758e
5 changed files with 28 additions and 6 deletions

View file

@ -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