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
Constants included from CrudController::PermittedParams
CrudController::PermittedParams::BLACKLIST
Instance Method Summary collapse
- #build_wizard_resource ⇒ Object
- #find_wizard_resource ⇒ Object
-
#resource_wizard_path(resource, step) ⇒ Object
It could be :new, :start Or resource, step.
- #resource_wizard_step_title(resource, step) ⇒ Object
- #resource_wizard_steps ⇒ Object
Methods included from WickedOverrides
Methods included from Save
Methods included from PermittedParams
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
Methods included from CrudController
#action_missing, #effective_resource, #resource, #resource=, #resources, #resources=
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_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_resource ⇒ Object
68 69 70 |
# File 'app/controllers/concerns/effective/wizard_controller.rb', line 68 def build_wizard_resource resource_scope.new end |
#find_wizard_resource ⇒ Object
60 61 62 63 64 65 66 |
# File 'app/controllers/concerns/effective/wizard_controller.rb', line 60 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
83 84 85 86 |
# File 'app/controllers/concerns/effective/wizard_controller.rb', line 83 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
72 73 74 75 |
# File 'app/controllers/concerns/effective/wizard_controller.rb', line 72 def resource_wizard_step_title(resource, step) return if step == 'wicked_finish' resource.wizard_step_title(step) end |
#resource_wizard_steps ⇒ Object
77 78 79 |
# File 'app/controllers/concerns/effective/wizard_controller.rb', line 77 def resource_wizard_steps effective_resource.klass.const_get(:WIZARD_STEPS).keys end |