Module: Wicked::Controller::Concerns::Path

Extended by:
ActiveSupport::Concern
Included in:
Wizard
Defined in:
lib/wicked/controller/concerns/path.rb

Instance Method Summary collapse

Instance Method Details

#next_wizard_path(options = {}) ⇒ Object



4
5
6
# File 'lib/wicked/controller/concerns/path.rb', line 4

def next_wizard_path(options = {})
  wizard_path(@next_step, options)
end

#next_wizard_url(options = {}) ⇒ Object



8
9
10
# File 'lib/wicked/controller/concerns/path.rb', line 8

def next_wizard_url(options = {})
  wizard_url(@next_step, options)
end

#previous_wizard_path(options = {}) ⇒ Object



12
13
14
# File 'lib/wicked/controller/concerns/path.rb', line 12

def previous_wizard_path(options = {})
  wizard_path(@previous_step, options)
end

#previous_wizard_url(options = {}) ⇒ Object



16
17
18
# File 'lib/wicked/controller/concerns/path.rb', line 16

def previous_wizard_url(options = {})
  wizard_url(@previous_step, options)
end

#wicked_actionObject



24
25
26
# File 'lib/wicked/controller/concerns/path.rb', line 24

def wicked_action
  params[:action]
end

#wicked_controllerObject



20
21
22
# File 'lib/wicked/controller/concerns/path.rb', line 20

def wicked_controller
  params[:controller]
end

#wizard_path(goto_step = nil, options = {}) ⇒ Object



28
29
30
31
32
33
34
35
36
# File 'lib/wicked/controller/concerns/path.rb', line 28

def wizard_path(goto_step = nil, options = {})
  options = options.respond_to?(:to_h) ? options.to_h : options
  options = { :controller => wicked_controller,
              :action     => 'show',
              :id         => goto_step || params[:id],
              :only_path  => true
             }.merge options
  url_for(options)
end

#wizard_url(goto_step = nil, options = {}) ⇒ Object



38
39
40
# File 'lib/wicked/controller/concerns/path.rb', line 38

def wizard_url(goto_step = nil, options = {})
  wizard_path(goto_step, options.merge(only_path: false))
end