Module: Crystal::AbstractController::Render::ClassMethods

Defined in:
lib/crystal/controller/abstract_controller/render.rb

Instance Method Summary collapse

Instance Method Details

#layout(layout, options = {}) ⇒ Object



80
81
82
83
84
# File 'lib/crystal/controller/abstract_controller/render.rb', line 80

def layout layout, options = {}
  before options do |controller|
    controller.layout = layout
  end
end

#template_name_for(action) ⇒ Object



86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/crystal/controller/abstract_controller/render.rb', line 86

def template_name_for action
  action = action.to_s

  return _template_name_for(action) if config.development?

  @template_name_for ||= {}

  unless tname = @template_name_for[action]          
    tname = _template_name_for(action)
    @template_name_for[action] = tname
  end

  tname
end