Added helper for referencing components from erbs
This commit is contained in:
parent
ac1ef00c5a
commit
15fa92fd36
|
@ -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
|
||||
|
|
Reference in New Issue
Block a user