Class: View

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_view.rb,
lib/rails_view/_lib.rb

Constant Summary collapse

VERSION =
'3.1.0'

Class Method Summary collapse

Class Method Details

.controller(&block) ⇒ Object



19
20
21
22
# File 'lib/rails_view.rb', line 19

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

.dependenciesObject



8
9
10
11
12
# File 'lib/rails_view/_lib.rb', line 8

def View.dependencies
  {
    'rails_current' => [ 'rails_current'    , '~> 2' ]
  }
end

.render(*args) ⇒ Object



24
25
26
27
28
29
30
31
32
33
# File 'lib/rails_view.rb', line 24

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

.versionObject



4
5
6
# File 'lib/rails_view/_lib.rb', line 4

def View.version
  View::VERSION
end