Class: Templates::TemplatesController

Inherits:
Object
  • Object
show all
Defined in:
app/controllers/templates/templates_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



3
4
5
# File 'app/controllers/templates/templates_controller.rb', line 3

def index
  render template: 'templates/index', layout: 'templates/index'
end

#showObject



7
8
9
10
11
12
13
# File 'app/controllers/templates/templates_controller.rb', line 7

def show
  if params[:id].present? && File.directory?("./app/views/#{Templates.views_path}/#{params[:id]}")
    render template: 'templates/nested_index', layout: 'templates/index'
  else
    render "#{Templates.views_path}/#{params[:id]}", layout: 'templates/show'
  end
end