Class: ShortStack::Controller.self::ViewContext
- Inherits:
-
Object
- Object
- ShortStack::Controller.self::ViewContext
- Includes:
- AnyView, Pancake::Mixins::RequestHelper
- Defined in:
- lib/short_stack/controller.rb
Class Method Summary collapse
Instance Method Summary collapse
- #_template_name_for(name, opts = {}) ⇒ Object
-
#env ⇒ Object
No way to get the env into the view context…
- #template(name_or_template, opts = {}) ⇒ Object
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 |
#env ⇒ Object
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 |