Module: Effective::WizardController

Extended by:
ActiveSupport::Concern
Includes:
CrudController, Actions, BeforeActions, PermittedParams, 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/permitted_params.rb,
app/controllers/concerns/effective/wizard_controller/wicked_overrides.rb

Defined Under Namespace

Modules: Actions, BeforeActions, ClassMethods, PermittedParams, Save, WickedOverrides

Constant Summary

Constants included from PermittedParams

PermittedParams::BLACKLIST

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 PermittedParams

#resource_permitted_params

Methods included from BeforeActions

#assign_current_step, #assign_page_title, #assign_required_steps, #assign_resource, #assign_resource_current_user, #authorize_resource, #clear_flash_success, #enforce_can_visit_step, #ready_checkout, #redirect_if_blank_step, #redirect_if_existing

Methods included from Actions

#new, #show, #update

Methods included from CrudController

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

Methods included from CrudController::Submits

#_insert_button, #_insert_on, #_insert_submit, #buttons, #ons, #submits

Methods included from CrudController::Save

#commit_action, #duplicate_resource, #notify_exception, #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_admin_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

#build_wizard_resourceObject



70
71
72
73
74
# File 'app/controllers/concerns/effective/wizard_controller.rb', line 70

def build_wizard_resource
  resource = resource_scope.new
  resource.strict_loading!(false) if resource.respond_to?(:strict_loading!)
  resource
end

#find_wizard_resourceObject



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

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

#resource_wizard_path(resource, step) ⇒ Object

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



87
88
89
90
# File 'app/controllers/concerns/effective/wizard_controller.rb', line 87

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



76
77
78
79
# File 'app/controllers/concerns/effective/wizard_controller.rb', line 76

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

#resource_wizard_stepsObject



81
82
83
# File 'app/controllers/concerns/effective/wizard_controller.rb', line 81

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