Skip to content

Commit 9dc5bfb

Browse files
committed
Support autoloading constants
1 parent e1aeb7b commit 9dc5bfb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/arbre/element.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ def clear_children!
174174
# 4. Call super
175175
#
176176
ruby2_keywords def method_missing(name, *args, &block)
177-
if current_arbre_element.respond_to?(name)
177+
if "Arbre::Components::#{name.to_s.camelize}".safe_constantize && respond_to?(name)
178+
public_send(name, *args, &block)
179+
elsif current_arbre_element.respond_to?(name)
178180
current_arbre_element.send name, *args, &block
179181
elsif assigns && assigns.has_key?(name)
180182
assigns[name]

0 commit comments

Comments
 (0)