Class: ShortStack::Controller.self::ViewContext

Inherits:
Object
  • Object
show all
Includes:
AnyView, Pancake::Mixins::RequestHelper
Defined in:
lib/short_stack/controller.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.template(name_or_template, opts = {}) ⇒ Object



22
23
24
25
# File 'lib/short_stack/controller.rb', line 22

def self.template(name_or_template, opts = {})
  opts[:format] ||= content_type
  super
end

Instance Method Details

#_template_name_for(name, opts = {}) ⇒ Object



32
33
34
35
# File 'lib/short_stack/controller.rb', line 32

def _template_name_for(name, opts = {})
  opts[:format] ||= :html
  "#{name}.#{opts[:format]}"
end

#envObject

No way to get the env into the view context… this is not good :(



18
19
20
# File 'lib/short_stack/controller.rb', line 18

def env
  _view_context_for.env
end

#template(name_or_template, opts = {}) ⇒ Object



27
28
29
30
# File 'lib/short_stack/controller.rb', line 27

def template(name_or_template, opts={})
  opts[:format] ||= content_type
  super
end