Module: Effective::WizardController::WickedOverrides

Included in:
Effective::WizardController
Defined in:
app/controllers/concerns/effective/wizard_controller/wicked_overrides.rb

Instance Method Summary collapse

Instance Method Details

#render_step(the_step, options = {}, params = {}) ⇒ Object

Override from wicked to support a fallback wizard step template



22
23
24
25
26
27
28
29
30
# File 'app/controllers/concerns/effective/wizard_controller/wicked_overrides.rb', line 22

def render_step(the_step, options = {}, params = {})
  if the_step.nil? || the_step.to_s == Wicked::FINISH_STEP
    redirect_to_finish_wizard(options, params)
  elsif lookup_context.exists?(the_step.to_s, lookup_context.prefixes)
    render(the_step, options)
  else
    render('effective/acts_as_wizard/wizard_step', options)
  end
end

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



9
10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/concerns/effective/wizard_controller/wicked_overrides.rb', line 9

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)

  merged_url_options = options.reverse_merge!(url_options)
  effective_resource.url_helpers.url_for(merged_url_options)
end