Method: EffectivePages.templates

Defined in:
lib/effective_pages.rb

.templatesObject



23
24
25
26
27
28
29
30
# File 'lib/effective_pages.rb', line 23

def self.templates
  ApplicationController.view_paths.map { |path| Dir["#{path}/#{pages_path}/**"] }.flatten.reverse.map do |file|
    name = File.basename(file).split('.').first
    next if name.starts_with?('_')
    next if Array(EffectivePages.excluded_pages).map { |str| str.to_s }.include?(name)
    name
  end.compact
end