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

Extended by:
ActiveSupport::Concern
Included in:
Action
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

#previous_wizard_path(options = {}) ⇒ Object



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

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

#wicked_actionObject



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

def wicked_action
  params[:action]
end

#wicked_controllerObject



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

def wicked_controller
  self.class.name.sub(/::\w+$/, '')
end

#wicked_controller_nameObject



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

def wicked_controller_name
  wicked_controller.sub(/Controller$/, '').gsub('::', '_').underscore
end

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



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

def wizard_path(goto_step = nil, options = {})
  id = goto_step || params[:id]
  path_method = "#{wicked_controller_name}_path"
  send path_method, id, options
end