about summary refs log tree commit diff
path: root/app/helpers/application_helper.rb
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-01-13 14:41:06 +0100
committerThibaut Girka <thib@sitedethib.com>2019-01-13 14:41:06 +0100
commiteff1c94744609b432c8dba8a35cd97e9a20ce652 (patch)
treee173621ead4c940b201d419971c291530d575103 /app/helpers/application_helper.rb
parent2cfa55185a5fc7d93a160a4e9a4730aae6725b0f (diff)
parent4fb94c758e3bf2e1c0525e9075c2d5dedc14c666 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app/helpers/application_helper.rb')
-rw-r--r--app/helpers/application_helper.rb8
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