Sha256: 0308c26a9b6c086d587b7f5e9cb6ed1b762bca5f286fb06226f0ff0b92045894

Contents?: true

Size: 377 Bytes

Versions: 2

Compression:

Stored size: 377 Bytes

Contents

class TemplatesController < Templates.parent_controller.constantize
  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

2 entries across 2 versions & 1 rubygems

Version Path
templates-rails-0.1.6 app/controllers/templates_controller.rb
templates-rails-0.1.5 app/controllers/templates_controller.rb