Problems in the Wicked Wizard controller

Can you have non-sedative methods in the controller that contains the WickedWizard gem?

Controller:

class Books::BookUpdateController < ApplicationController

  include Wicked::Wizard
  steps :title_step,  :ai_archive_step, :ai_override_step #etc

   def show
      ...
   end

   def update
      ...
   end

   def waterfall
      ...# loads of code to set up instance variables in the view, which I don't want to have to include in the normal show action for all the wizard steps. 
   end
end

Routes:

resources :book_update do     
  member do
    get 'waterfall'
    ... and others 
  end
end

Version 1 and the lower part of the gem allow you to perform non-calming actions, but this commit to solve this PR sets the names of the steps. My mistake when switching to this route http://localhost:3000/book_update/3949/waterfallis

Wicked::Wizard::InvalidStepError in Books::BookUpdateController#waterfall

The requested step did not match any steps defined for this controller.

I suppose I should light a new controller and turn on carefree activities there, but the alternatives would be great.

+4
source share
1 answer

You need to add:

skip_before_filter :setup_wizard, only: :waterfall

in your evil controller

+10
source

All Articles