Class: RailsAndSolid::Helper::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/rails-and-solid/helper/result.rb

Instance Method Summary collapse

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, options = {}, &block)
  options[:text] = content
  @controller.render(options, &block)
end