module Prototypical::Controller

Public Class Methods

included(base) click to toggle source
# File lib/prototypical/controller.rb, line 3
def self.included(base)
  base.before_action :enable_prototyping if Prototypical.enable_on_include?
end

Public Instance Methods

enable_prototyping() click to toggle source
# File lib/prototypical/controller.rb, line 7
def enable_prototyping
  return unless Prototypical.enabled?

  append_prototypical_view_path
end

Private Instance Methods

append_prototypical_view_path() click to toggle source
# File lib/prototypical/controller.rb, line 14
def append_prototypical_view_path
  prepend_view_path Rails.root.join(Prototypical.view_path)
end