Class: Blacklight::Component

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
lib/blacklight/component.rb

Class Method Summary collapse

Class Method Details

.reset_compiler!Object



8
9
10
# File 'lib/blacklight/component.rb', line 8

def reset_compiler!
  @__vc_compiler = nil
end

.sidecar_files(*args, **kwargs) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/blacklight/component.rb', line 12

def sidecar_files(*args, **kwargs)
  upstream_sidecar_files(*args, **kwargs).map do |path|
    app_path = Rails.root.join(path.slice(path.index(view_component_path)..-1).to_s).to_s

    if File.exist?(app_path)
      app_path
    else
      path
    end
  end
end

.upstream_sidecar_filesObject



6
# File 'lib/blacklight/component.rb', line 6

alias upstream_sidecar_files sidecar_files