Module: Effective::WizardController

Extended by:
ActiveSupport::Concern
Includes:
CrudController, Actions, BeforeActions, Save, WickedOverrides, Wicked::Wizard
Defined in:
app/controllers/concerns/effective/wizard_controller.rb,
app/controllers/concerns/effective/wizard_controller/save.rb,
app/controllers/concerns/effective/wizard_controller/actions.rb,
app/controllers/concerns/effective/wizard_controller/before_actions.rb,
app/controllers/concerns/effective/wizard_controller/wicked_overrides.rb

Defined Under Namespace

Modules: Actions, BeforeActions, Save, WickedOverrides

Constant Summary

Constants included from CrudController::PermittedParams

CrudController::PermittedParams::BLACKLIST

Instance Method Summary collapse

Methods included from WickedOverrides

#wizard_path

Methods included from Save

#save_wizard_resource

Methods included from BeforeActions

#assign_current_step, #assign_page_title, #assign_required_steps, #assign_resource, #authorize_resource, #enforce_can_visit_step, #ready_checkout, #redirect_if_blank_step

Methods included from Actions

#new, #show, #update

Methods included from CrudController

#action_missing, #effective_resource, #resource, #resource=, #resources, #resources=

Methods included from CrudController::Save

#commit_action, #duplicate_resource, #reload_resource, #resource_flash, #save_resource

Methods included from CrudController::Respond

#respond_with_error, #respond_with_success

Methods included from CrudController::PermittedParams

#resource_active_model_permitted_params, #resource_permitted_params

Methods included from CrudController::Paths

#referer_redirect_path, #resource_action_path, #resource_destroy_path, #resource_duplicate_path, #resource_edit_path, #resource_index_path, #resource_new_path, #resource_redirect_path, #resource_show_path, #specific_redirect_path?

Methods included from CrudController::Actions

#collection_action, #create, #destroy, #edit, #index, #member_action, #new, #show, #update

Instance Method Details

#find_wizard_resourceObject



43
44
45
46
47
48
49
# File 'app/controllers/concerns/effective/wizard_controller.rb', line 43

def find_wizard_resource
  if params[resource_name_id] && params[resource_name_id] != 'new'
    resource_scope.find(params[resource_name_id])
  else
    resource_scope.new
  end
end

#resource_wizard_path(resource, step) ⇒ Object

It could be :new, :start Or resource, step



62
63
64
65
# File 'app/controllers/concerns/effective/wizard_controller.rb', line 62

def resource_wizard_path(resource, step)
  param = (resource.respond_to?(:to_param) ? resource.to_param : resource)
  wizard_path(step, resource_name_id => param)
end

#resource_wizard_step_title(resource, step) ⇒ Object



51
52
53
54
# File 'app/controllers/concerns/effective/wizard_controller.rb', line 51

def resource_wizard_step_title(resource, step)
  return if step == 'wicked_finish'
  resource.wizard_step_title(step)
end

#resource_wizard_stepsObject



56
57
58
# File 'app/controllers/concerns/effective/wizard_controller.rb', line 56

def resource_wizard_steps
  effective_resource.klass.const_get(:WIZARD_STEPS).keys
end