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
- #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 BeforeActions
#assign_current_step, #assign_page_title, #assign_required_steps, #assign_resource, #authorize_resource, #enforce_can_visit_step, #redirect_if_blank_step
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, #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_resource ⇒ Object
41 42 43 44 45 46 47 |
# File 'app/controllers/concerns/effective/wizard_controller.rb', line 41 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
60 61 62 63 |
# File 'app/controllers/concerns/effective/wizard_controller.rb', line 60 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
49 50 51 52 |
# File 'app/controllers/concerns/effective/wizard_controller.rb', line 49 def resource_wizard_step_title(resource, step) return if step == 'wicked_finish' resource.wizard_step_title(step) end |
#resource_wizard_steps ⇒ Object
54 55 56 |
# File 'app/controllers/concerns/effective/wizard_controller.rb', line 54 def resource_wizard_steps effective_resource.klass.const_get(:WIZARD_STEPS).keys end |