Class: Gors::Controller
- Inherits:
-
Object
- Object
- Gors::Controller
- Defined in:
- lib/gors.rb
Instance Attribute Summary collapse
-
#info ⇒ Object
Returns the value of attribute info.
Instance Method Summary collapse
- #erb(template) ⇒ Object
-
#initialize(context) ⇒ Controller
constructor
A new instance of Controller.
- #params ⇒ Object
Constructor Details
#initialize(context) ⇒ Controller
Returns a new instance of Controller.
179 180 181 182 183 184 |
# File 'lib/gors.rb', line 179 def initialize(context) @info = context if(self.respond_to? "before") self.before end end |
Instance Attribute Details
#info ⇒ Object
Returns the value of attribute info.
177 178 179 |
# File 'lib/gors.rb', line 177 def info @info end |
Instance Method Details
#erb(template) ⇒ Object
186 187 188 189 190 |
# File 'lib/gors.rb', line 186 def erb template renderer = Tilt::ERBTemplate.new("views/layout.erb") output = renderer.render(self){ Tilt::ERBTemplate.new("views/"+template.to_s+".erb").render(self) } return output end |
#params ⇒ Object
192 193 194 |
# File 'lib/gors.rb', line 192 def params @info.request.params end |