From 4fb94c758e3bf2e1c0525e9075c2d5dedc14c666 Mon Sep 17 00:00:00 2001 From: ThibG Date: Sun, 13 Jan 2019 10:23:54 +0100 Subject: Add attachment list fallback to public pages (#9780) * Add attachment list fallback to public pages Fixes #6714 * Refactor attachments lists --- app/helpers/application_helper.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'app/helpers') 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 -- cgit