Module: Cms::Behaviors::Rendering::MacroMethods

Defined in:
lib/cms/behaviors/rendering.rb

Instance Method Summary collapse

Instance Method Details

#is_renderable(options = {}) ⇒ Object


35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/cms/behaviors/rendering.rb', line 35

def is_renderable(options={})

  @instance_variable_name_for_view = options[:instance_variable_name_for_view]

  extend ClassMethods
  extend EngineHelper
  include InstanceMethods

  # I'm not pleased with the need to include all of the these rails helpers onto every 'renderable' content item
  # It's likely to lead to unfortunate side effects.
  # Need to determine how this can be simplified.

  # Required to make the calls to add Rails Core controllers work
  include ActiveSupport::Configurable

  # Include all the core rails helpers
  include ActionController::Helpers
  include ActionController::RequestForgeryProtection

  helper ApplicationHelper

  attr_accessor :controller
  delegate :params, :session, :request, :flash, :to => :controller

end

#renderable?Boolean


31
32
33
# File 'lib/cms/behaviors/rendering.rb', line 31

def renderable?
  false
end