Module: Vuexy::Components::Base

Included in:
Header, Navigation
Defined in:
app/controllers/concerns/vuexy/components/base.rb

Instance Method Summary collapse

Instance Method Details

#load_yaml(file:) ⇒ Object

include Rails.application.routes.url_helpers



8
9
10
11
12
13
14
15
16
# File 'app/controllers/concerns/vuexy/components/base.rb', line 8

def load_yaml(file:)
  YAML.safe_load(
    ERB.new(
      File.read(
        File.join(Rails.root, 'app', 'views', controller_path.split('/').first, "#{file}.yml")
      )
    ).result
  )
end