Sha256: 2447971dcb1b0ff314f143c429ea6d43cc485d20fa6ca0900ecc8227159244c9

Contents?: true

Size: 833 Bytes

Versions: 2

Compression:

Stored size: 833 Bytes

Contents

# frozen_string_literal: true

module Scrapbook
  # This controller is used to specify view paths to check if a template exists.
  #
  # Scapbook views (Rails templates) exist outside the normal Rails views hierarchy. This is
  # fine, we can prepend the view path for Scrapbook pages to our controller when we need to
  # render Scrapbook pages. However, part of the process for to determine if we need to
  # render a Scrapbook page is determining if the template exists. We want to know if the
  # template exists before we prepend the path to the controller and render it. This empty
  # controller allows us to call `EmptyController#template_exists?` to do just that after we
  # prepend the view path to it.
  class EmptyController < ApplicationController
    self.view_paths = []
  end
  private_constant :EmptyController
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
scrapbook-0.3.2 app/controllers/scrapbook/empty_controller.rb
scrapbook-0.3.1 app/controllers/scrapbook/empty_controller.rb