Class: Goldencobra::Template

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/goldencobra/template.rb

Class Method Summary collapse

Class Method Details

.layouts_for_selectArray

List all layout files found in folder /app/views/layouts

Returns:

  • (Array)

    List of file names



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