Module: Effective::WizardController

Extended by:
ActiveSupport::Concern
Includes:
CrudController, Actions, BeforeActions, Save, 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

Defined Under Namespace

Modules: Actions, BeforeActions, Save

Constant Summary

Constants included from CrudController::PermittedParams

CrudController::PermittedParams::BLACKLIST

Instance Method Summary collapse

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, #redirect_if_blank_step

Methods included from Actions

#new, #show, #update

Methods included from CrudController

#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



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

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



59
60
61
62
# File 'app/controllers/concerns/effective/wizard_controller.rb', line 59

def resource_wizard_path(resource, step)
  path_helper = effective_resource.action_path_helper(:show).to_s.sub('_path', '_build_path')
  public_send(path_helper, resource, step)
end

#resource_wizard_step_title(step) ⇒ Object



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

def resource_wizard_step_title(step)
  return if step == 'wicked_finish'
  effective_resource.klass.const_get(:WIZARD_STEPS).fetch(step)
end

#resource_wizard_stepsObject



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

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