Sha256: 4726988eed7c6ad2a01b3a70bf8b518f8310a956005dd818233465257377c2ef

Contents?: true

Size: 359 Bytes

Versions: 1

Compression:

Stored size: 359 Bytes

Contents

class TemplatesController < ActionController::Base
  def index
    render :index, layout: 'templates/index'
  end

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
templates-rails-0.1.1 app/controllers/templates_controller.rb