Class: Dao::Errors2Html::View

Inherits:
Object
  • Object
show all
Defined in:
lib/dao/errors2html.rb

Class Method Summary collapse

Class Method Details

.controller(&block) ⇒ Object



4
5
6
7
# File 'lib/dao/errors2html.rb', line 4

def View.controller(&block)
  controller = ::Current.controller ? ::Current.controller.dup : ::Current.mock_controller
  block ? controller.instance_eval(&block) : controller
end

.render(*args) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/dao/errors2html.rb', line 9

def View.render(*args)
  options = args.extract_options!.to_options!
  args.push(options)

  unless options.has_key?(:layout)
    options[:layout] = false
  end

  Array(View.controller{ render(*args) }).join.html_safe
end