Class: Cmsimple::TemplateResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/cmsimple/template_resolver.rb

Class Method Summary collapse

Class Method Details

.allObject



3
4
5
6
7
8
9
10
11
12
# File 'lib/cmsimple/template_resolver.rb', line 3

def self.all
  templates = []
  ActionController::Base.view_paths.each do |path|
    template_directory = File.join(path, Cmsimple.configuration.template_path)
    Dir[File.join(template_directory, "*.*")].each do |file|
      templates << File.basename(file).split('.').first
    end
  end
  templates.uniq
end