title: Wicked Rails Gem Help Wiring Up
body: <p>I want to do a multi-step form for taking in new information.  One page I want to collect name/contact info, the next page I want to collect medical history, the third page demographic information.</p>
  
  <p>I've installed the Wizard gem and generated a dedicated controller.  All of the tutorials I've seen on it apply to devise and the signup process so I'm a little bit lost on the controller actions and the instance variables and how I should be writing them.</p>
  
  <p>Was wondering if anyone has a tutorial other than a sign-up one that could maybe help me along in learning how to get this all wired up.</p>
  
  <p>Any pointers or assistance is appreciated.</p>
  
  <p>EDIT:</p>
  
  <p>I think my problem is in the controller for my wizard.</p>
  
  <p>In the show and update actions the demo shows to declare the variable of</p>
  
  <pre><code>@user = current_user
  </code></pre>
  
  <p>That's great, but it's a helper method that I don't need.  I need to create a patient, store the patient_id in a session which I do in my create action in my main patients controller.  Then somehow pass that over to the patientsteps controller.</p>
  
  <p>Here's what I've tried in patientsteps</p>
  
  <pre><code>class PatientstepsController &lt; Wicked::WizardController
    before_filter :authenticate_user!
  
    steps :medical, :summary
  
    def show
      @patient = Patient.find(params[:patient_id])
      render_wizard
    end
  
    def update
      @patient = Patient.find(params[:id])
      @patient.attributes = params[:patient]
      render_wizard @patient
    end
  end
  </code></pre>
  
  <p>When I do this, I get cannot find a patient without and ID.  I understand that I'm doing this wrong, but I'm not sure how to pass in the patient_id that was created in my patients controller create action.  </p>
  
  <p>Patients Controller Create:</p>
  
  <pre><code> def create
      @patient = Patient.new(params[:patient])
  
      if @patient.save
          session[:patient_id] = @patient.id
          redirect_to patientsteps_path, notice: "Patient was successfully created."
        else
          render :new
       end
    end
  </code></pre>