Class: Formatic::Engine

Inherits:
Rails::Engine
  • Object
show all
Defined in:
lib/formatic/engine.rb

Overview

:nodoc:

Class Method Summary collapse

Class Method Details

.require_formatic_componentsObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/formatic/engine.rb', line 15

def self.require_formatic_components
  # Our Formatic components are subclasses of `ViewComponent::Base`.
  # When `ViewComponent::Base` is subclassed, two things happen:
  #
  #   1. Rails routes are included into the component
  #   2. The ViewComponent configuration is accessed
  #
  # So we can only require our components, once Rails has booted
  # AND the view_component gem has been fully initialized (configured).
  #
  # That's right here and now.
  require_relative '../../app/components/formatic/application_component'
  require_relative '../../app/components/formatic/wrapper'
  require_relative '../../app/components/formatic/base'

  # Components
  require_relative '../../app/components/formatic/toggle'
  require_relative '../../app/components/formatic/checklist'
  require_relative '../../app/components/formatic/date'
  require_relative '../../app/components/formatic/select'
  require_relative '../../app/components/formatic/string'
  require_relative '../../app/components/formatic/stepper'
  require_relative '../../app/components/formatic/textarea'
end