lib/appyantra_admin/utils.rb
# returns the list of available page layouts
returns the list of available page layouts
returns the list of available page layouts
def list_page_layouts(layouts=[])
      if layouts.empty?
        layouts_path = Rails.root + "app/views/layouts"
        if Dir.exists? layouts_path
          Dir.foreach(layouts_path) do |file_name|
            if file_name.include? '.html.haml'
              layouts << File.basename(file_name,'.html.haml')
            elsif file_name.include? '.html.erb'
              layouts << File.basename(file_name,'.html.erb')
            end
          end
        end
        layouts << 'application' if layouts.empty?
      end
      layouts
    end
def list_page_layouts ( layouts = [ ] ) if layouts . empty? layouts_path = Rails . root + "app/views/layouts" if Dir . exists? layouts_path Dir . foreach ( layouts_path ) do | file_name | if file_name . include? '.html.haml' layouts << File . basename ( file_name , '.html.haml' ) elsif file_name . include? '.html.erb' layouts << File . basename ( file_name , '.html.erb' ) end end end layouts << 'application' if layouts . empty? end layouts end
returns the list of available page layouts
returns the list of available page layouts
layouts