Module: Primer::Forms::ActsAsComponent
- Included in:
- Base, BaseComponent, FormList
- Defined in:
- lib/primer/forms/acts_as_component.rb
Overview
:nodoc:
Defined Under Namespace
Modules: InstanceMethods Classes: TemplateGlob, TemplateParams
Instance Attribute Summary collapse
-
#template_root_path ⇒ Object
Returns the value of attribute template_root_path.
Class Method Summary collapse
Instance Method Summary collapse
- #compile! ⇒ Object
- #renders_templates(glob_pattern, method_name = nil, &block) ⇒ Object (also: #renders_template)
Instance Attribute Details
#template_root_path ⇒ Object
Returns the value of attribute template_root_path.
54 55 56 |
# File 'lib/primer/forms/acts_as_component.rb', line 54 def template_root_path @template_root_path end |
Class Method Details
.extended(base) ⇒ Object
47 48 49 |
# File 'lib/primer/forms/acts_as_component.rb', line 47 def self.extended(base) base.include(InstanceMethods) end |
Instance Method Details
#compile! ⇒ Object
61 62 63 64 65 66 67 68 69 70 |
# File 'lib/primer/forms/acts_as_component.rb', line 61 def compile! # always recompile in dev return if defined?(@compiled) && @compiled && !Rails.env.development? template_globs.each do |template_glob| compile_templates_in(template_glob) end @compiled = true end |
#renders_templates(glob_pattern, method_name = nil, &block) ⇒ Object Also known as: renders_template
56 57 58 |
# File 'lib/primer/forms/acts_as_component.rb', line 56 def renders_templates(glob_pattern, method_name = nil, &block) template_globs << TemplateGlob.new(glob_pattern, method_name, block) end |