title: Can any one give me a hint how to get the spot_id?
body: <p>I am trying to make a car park booking application and general booking works. When I type in <code>user id</code>, <code>spot id</code> and select <code>is_booked</code>.
  Now I would like the button next to the list of spots to work the same way, but I can't get the id of the spot, like this:</p>
  <pre><code>    &lt;% @spots.each do |spot| %&gt;
        &lt;tr&gt;
          &lt;td&gt;&lt;%= spot.name %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= link_to 'Show', spot %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= link_to 'Edit', edit_spot_path(spot) %&gt;&lt;/td&gt;
          &lt;td&gt;&lt;%= link_to 'Booking', new_booking_path %&gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;% end %&gt;
    &lt;/tbody&gt;
  </code></pre>
  <p>The path at the moment is to new_booking but only for preview,eventually it will be create_booking.</p>
  <p>I've tried several ways but none works, I am able to reference all ids but not a single id. This one is sample from booking_controller to new_booking definition and I give these parameters:</p>
  <p><code>@booking = current_user.bookings.build(:spot_id =&gt; Spot.ids, :is_booked =&gt; true)</code></p>
  <p>I hope I've described the problem clearly. I'm fairly new to ruby and this seems to be a trivial error that I don't know how to fix. please help.</p>