title: rails 3 nested resource `new` path being switched
body: <p>I don't quite get why this is happening, maybe someone of you does... here it goes.</p>
  
  <p>I've created a nested resource:</p>
  
  <pre><code>resources :order do
    resources :ordered_vehicles
  end
  </code></pre>
  
  <p>I've added a <code>link_to</code> the <code>new</code> action and passed the <code>order.id</code> like so <code>new_order_ordered_vehicle_path(order.id)</code> the page is loaded nicely. The problem is after I press the button to submit the choice. He switches the path from <code>http://localhost:3000/order/3/ordered_vehicles/new</code> to <code>http://localhost:3000/order/R076027535/ordered_vehicles</code> and displays error <code>Couldn't find Order with id=R076027535</code>... go figure.</p>
  
  <p>The error is being raised in the controller in this method</p>
  
  <pre><code>private
    def find_order
      @order = Order.find(params[:order_id])
    end
  </code></pre>
  
  <p>Which is a <code>before_filter</code>.</p>
  
  <p>the <code>new.html.haml</code> file looks like this</p>
  
  <pre><code>= form_for [@order, @ordered_vehicle], html: { multipart: true } do |f|
    = @order.number
    %br= @order.id
      = f.fields_for :vehicles do |car|
        .... #some fields here
        = car.submit "Save your choice"
  </code></pre>
  
  <p>That <code>id</code> he can't find is the <code>@order.number</code> but I don't get why the switch.</p>
  
  <p>EDIT:
  Just to be thorough, I'll add the controller methods:</p>
  
  <pre><code>def new
    @ordered_vehicle = @order.ordered_vehicles.build(params.slice(:order_id, :vehicle_id))
  end
  
  def create
    binding.pry
    @ordered_vehicle = @order.ordered_vehicles.build(params.slice(:order_id, :vehicle_id))
    if @ordered_vehicle.save
      flash[:notice] = "Save successful."
      redirect_to account_path
    end
  end
  </code></pre>
  
  <p>POST request (I hope that's the one, still new to all this stuff):</p>
  
  <pre><code>"action_dispatch.request.formats"=&gt;[text/html]},
   @request_method="POST", @filtered_parameters={"utf8"=&gt;"✓", "authenticity_token"=&gt;
   "Ar4vy8pqCSpA2ch0qG0qiJXAJUbNALYxm/FbuKbdzCc=", "ordered_vehicle"=&gt;
   {"vehicles"=&gt;   {"maker_id"=&gt;"", "model_id"=&gt;"", "year"=&gt;"", "body"=&gt;"", "capacity"=&gt;"", "id"=&gt;"1"}},
   "commit"=&gt;"Save your choice", "action"=&gt;"create",
   "controller"=&gt;"spree/ordered_vehicles", "order_id"=&gt;"R076027535"}, @method="POST",
   @fullpath="/order/R076027535/ordered_vehicles"&gt;
  </code></pre>