Module: Rad::AbstractController::Render

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

Defined Under Namespace

Modules: ClassMethods

Constant Summary collapse

SPECIAL_FORMAT_HANDLERS =
{
  json: lambda{|o| o.to_json},
  xml: lambda{|o| o.to_xml},
  js: lambda{|o| o},        
}

Instance Method Summary collapse

Instance Method Details

#_layout(tname = nil) ⇒ Object

SPECIAL_CASES_HANDLERS = [

['inline', lambda{|o| o}],

]



14
15
16
17
18
19
20
# File 'lib/rad/controller/abstract_controller/render.rb', line 14

def _layout tname = nil        
  if tname
    @_layout = tname
  else          
    @_layout
  end
end

#_layout=(layout) ⇒ Object



21
22
23
# File 'lib/rad/controller/abstract_controller/render.rb', line 21

def _layout= layout
  @_layout = layout
end

#render(*args) ⇒ Object



25
26
27
28
29
# File 'lib/rad/controller/abstract_controller/render.rb', line 25

def render *args        
  options = Template.parse_arguments *args
  content = render_with_parsed_arguments options, args
  throw :halt_render, content
end