Class: UiController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/ui_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/ui_controller.rb', line 4

def index
  # Scan main app views/ui folder for templates
  @template_names = Dir.glob('app/views/ui/*').inject([]) do |result, file|
    file_name = File.basename(file)

    # Don't select partials and directories
    if file_name !~ /^_/ && File.file?(file)
      result << file_name.sub(/\.html.*$/, '')
    end

    result
  end

  render layout: false
end