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.



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

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

#callObject



48
49
50
# File 'lib/cell/rails.rb', line 48

def call(*)
  super.html_safe
end

#perform_caching?Boolean

Returns:

  • (Boolean)


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

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

#protect_against_forgery?Boolean

TODO: implement forgery protection with ActionController.

Returns:

  • (Boolean)


44
45
46
# File 'lib/cell/rails.rb', line 44

def protect_against_forgery? # TODO: implement forgery protection with ActionController.
  false
end