Class: RailsAndSolid::Helper::Result
- Inherits:
-
Object
- Object
- RailsAndSolid::Helper::Result
- Defined in:
- lib/rails-and-solid/helper/result.rb
Instance Method Summary collapse
-
#initialize(controller) ⇒ Result
constructor
A new instance of Result.
- #redirect_to(where = nil) ⇒ Object
- #render(*args, &block) ⇒ Object
- #text(content, options = {}, &block) ⇒ Object
Constructor Details
#initialize(controller) ⇒ Result
Returns a new instance of Result.
4 5 6 |
# File 'lib/rails-and-solid/helper/result.rb', line 4 def initialize(controller) @controller = controller end |
Instance Method Details
#redirect_to(where = nil) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/rails-and-solid/helper/result.rb', line 8 def redirect_to(where = nil) if where @controller.redirect_to @controller.send("#{where.to_s}_path") else RedirectTo.new(@controller) end end |
#render(*args, &block) ⇒ Object
16 17 18 |
# File 'lib/rails-and-solid/helper/result.rb', line 16 def render(*args, &block) @controller.render *args, &block end |
#text(content, options = {}, &block) ⇒ Object
20 21 22 23 |
# File 'lib/rails-and-solid/helper/result.rb', line 20 def text(content, = {}, &block) [:text] = content @controller.render(, &block) end |