Module: Cell::RailsExtensions::ViewModel

Extended by:
ActiveSupport::Concern
Defined in:
lib/cell/rails.rb

Overview

Gets included into Cell::ViewModel in a Rails environment.

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#cache_storeObject

we want to use DI to set a cache store in cell/rails.



66
67
68
# File 'lib/cell/rails.rb', line 66

def cache_store  # we want to use DI to set a cache store in cell/rails.
  ::ActionController::Base.cache_store
end

#callObject



53
54
55
# File 'lib/cell/rails.rb', line 53

def call(*)
  super.html_safe
end

#parent_controllerObject Also known as: controller



57
58
59
# File 'lib/cell/rails.rb', line 57

def parent_controller
  context[:controller]
end

#perform_caching?Boolean



62
63
64
# File 'lib/cell/rails.rb', line 62

def perform_caching?
  ::ActionController::Base.perform_caching
end