Module: Ariadne::Forms::ActsAsComponent

Included in:
Ariadne::Form::BaseComponent, Base
Defined in:
lib/ariadne/forms/acts_as_component.rb

Overview

:nodoc:

Defined Under Namespace

Modules: InstanceMethods Classes: TemplateGlob, TemplateParams

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#template_root_pathObject

Returns the value of attribute template_root_path.



52
53
54
# File 'lib/ariadne/forms/acts_as_component.rb', line 52

def template_root_path
  @template_root_path
end

Class Method Details

.extended(base) ⇒ Object



45
46
47
# File 'lib/ariadne/forms/acts_as_component.rb', line 45

def self.extended(base)
  base.include(InstanceMethods)
end

Instance Method Details

#compile!Object



59
60
61
62
63
64
65
66
67
68
# File 'lib/ariadne/forms/acts_as_component.rb', line 59

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



54
55
56
# File 'lib/ariadne/forms/acts_as_component.rb', line 54

def renders_templates(glob_pattern, method_name = nil, &block)
  template_globs << TemplateGlob.new(glob_pattern, method_name, block)
end