Class: Goldencobra::Template
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Goldencobra::Template
- Defined in:
- app/models/goldencobra/template.rb
Class Method Summary collapse
-
.layouts_for_select ⇒ Array
List all layout files found in folder /app/views/layouts.
Class Method Details
.layouts_for_select ⇒ Array
List all layout files found in folder /app/views/layouts
8 9 10 11 12 |
# File 'app/models/goldencobra/template.rb', line 8 def self.layouts_for_select Dir.glob(File.join(::Rails.root, "app", "views", "layouts", "*.html.erb")) .map { |a| File.basename(a, ".html.erb") } .delete_if { |a| a =~ /^_/ } end |