diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 15b06f0..deacfb1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,4 +1,10 @@ # frozen_string_literal: true module ApplicationHelper + def component(component_name, locals = {}, &block) + name = component_name.split("_").first + render("components/#{name}/#{component_name}", locals, &block) + end + + alias c component end