title: Wicked gem cannot find wedding ID in update action
body: <p>I'm trying to implement the 'Wicked' gem for wizards and cannot figure out this error for the life of me. Already referenced <a href="http://railscasts.com/episodes/346-wizard-forms-with-wicked" rel="nofollow noreferrer">Ryan bates railscast #346</a> and the <a href="https://github.com/schneems/wicked/wiki/Building-Partial-Objects-Step-by-Step" rel="nofollow noreferrer">step by step tutorial by schneems</a>.</p>
  <p>I have 2 controllers: Weddings and Wedding_steps. The user initially creates a Wedding and after the create action is redirected to the Wedding_steps controller (which uses Wicked) to update the wedding model with additional info.</p>
  <p>The wedding_id is successfully detected in the first step weddingdetails, but after submitting that step, I get the following error:</p>
  <p><strong>ERROR</strong></p>
  <blockquote>
  <p>ActiveRecord::RecordNotFound in WeddingStepsController#update</p>
  <p>Couldn't find Wedding without an ID:
  app/controllers/wedding_steps_controller.rb:11:in `update'</p>
  <p>Parameters:</p>
  <p>{&quot;utf8&quot;=&gt;&quot;✓&quot;,
  &quot;_method&quot;=&gt;&quot;put&quot;,
  &quot;authenticity_token&quot;=&gt;&quot;JMd+8gf4rVqOSNMSFrKcD3WxK+X3zvYliSMWqTg0SkE=&quot;,
  &quot;wedding&quot;=&gt;{&quot;bridename&quot;=&gt;&quot;&quot;,
  &quot;groomname&quot;=&gt;&quot;&quot;,
  &quot;weddingdate&quot;=&gt;&quot;&quot;,
  &quot;weddingcity&quot;=&gt;&quot;&quot;,
  &quot;weddingstate&quot;=&gt;&quot;&quot;,
  &quot;url&quot;=&gt;&quot;&quot;},
  &quot;commit&quot;=&gt;&quot;Next&quot;,
  &quot;id&quot;=&gt;&quot;wedding_id=11&quot;}</p>
  </blockquote>
  <p>It is supposed to continue to the next step <code>/wedding_steps/eventdetails?wedding_id=11</code> but instead gives the error and goes to <code>/wedding_steps/wedding_id=11</code></p>
  <p>Also of note is that without the Update action in place, the information successfully saves and redirects to the Wedding Show action.</p>
  <p>Here is the relevant code:</p>
  <p><strong>wedding_steps_controller.rb</strong></p>
  <pre><code>class WeddingStepsController &lt; ApplicationController
  include Wicked::Wizard
  steps :weddingdetails, :eventdetails
  
  def show
      @wedding = Wedding.find(params[:wedding_id])
      render_wizard
  end
  
  def update
      @wedding = Wedding.find(params[:wedding_id])
      @wedding.update_attributes(params[:wedding])
      render_wizard @wedding
  end
  
  end
  </code></pre>
  <p><strong>weddings_controller.rb</strong></p>
  <pre><code>def create
  @wedding = current_user.weddings.new(params[:wedding])
  
  
  respond_to do |format|
    if @wedding.save
      format.html { redirect_to wedding_steps_path(:id =&gt; &quot;weddingdetails&quot;, :wedding_id =&gt; @wedding.id) }
      format.json { render json: @wedding, status: :created, location: @wedding }
    else
      format.html { render action: &quot;new&quot; }
      format.json { render json: @wedding.errors, status: :unprocessable_entity }
    end
  end
  end
  </code></pre>
  <p><strong>STEP 1: wedding_steps/weddingdetails.html.erb</strong></p>
  <pre><code>&lt;%= simple_form_for(@wedding, :url =&gt; wizard_path(wedding_id: @wedding.id), :method =&gt; :put, html: { class: 'form-horizontal'}) do |f| %&gt;
  &lt;%= f.error_notification %&gt;
  &lt;div class=&quot;form-inputs&quot;&gt;
  
  
  &lt;div class=&quot;formrow center&quot;&gt;
    &lt;%= f.input :bridename, placeholder: &quot;The Bride's Name&quot;, label: false %&gt;
    &lt;h2 class=&quot;inline&quot;&gt;  &amp;&lt;/h2&gt;
    &lt;%= f.input :groomname, placeholder: &quot;The Groom's Name&quot;, label: false %&gt;
  &lt;/div&gt;
  
  
  &lt;div class=&quot;formrow center&quot;&gt;
    &lt;%= f.text_field :weddingdate %&gt; 
    &lt;!-- OLD STYLE DATE FORMAT &lt;%= f.input :weddingdate, label: &quot;Wedding Date&quot; %&gt; --&gt;
    &lt;%= f.input :weddingcity, label: &quot;City&quot; %&gt;
    &lt;%= f.input :weddingstate, label: &quot;State&quot; %&gt;
  &lt;/div&gt;
  
  
  &lt;div class=&quot;formrow center&quot;&gt; 
    &lt;%= f.input :url, placeholder: &quot;i.e. 'johnandkate' &quot;, label: false %&gt; 
  &lt;/div&gt;
  
  &lt;/div&gt;
  
  
  &lt;div class=&quot;form-actions center&quot;&gt;
  &lt;%= f.button :submit, value: &quot;Next&quot; %&gt;
  &lt;/div&gt;
  
  
  
  &lt;% end %&gt;
  
  &lt;%= link_to 'skip', next_wizard_path(wedding_id: @wedding.id) %&gt;
  </code></pre>
  <p><strong>STEP 2: wedding_steps/eventdetails.html.erb</strong></p>
  <pre><code>EVENT DETAILS STEP &lt;!--PLACEHOLDER FOR NOW --&gt;
  </code></pre>
  <p><strong>Routes.rb</strong></p>
  <pre><code>Jobshop::Application.routes.draw do    
      resources :pins
      resources :weddings
      resources :wedding_steps  
  
      get &quot;users/show&quot;
  
      root :to =&gt; 'pages#home'
      get 'about' =&gt; 'pages#about'
  
      devise_for :admin_users, ActiveAdmin::Devise.config
      ActiveAdmin.routes(self)
  
      resources :inviterequests
  
  
      devise_for :views
      ActiveAdmin.routes(self)
  
      devise_for :users
      ActiveAdmin.routes(self)
  
      match 'users/:id' =&gt; 'users#show'
  
      
  </code></pre>