Rails render partial with :collection
This is so simple it shouldnt be an issue but I dont understand whats going on here. I have the following code class DashboardController < ApplicationController def bookings @bookings = Booking.all end end /views/dashboard/bookings.html.erb <%= render 'booking', :collection => @bookings %> /views/dashboard/_booking.html.erb <%= booking.booking_time %> I get the following error undefined method `booking_time' for nil:NilClass However if I do this in /views/dashboard/_bookings.html.erb <% @bookings.each do |booking| %> <%= render 'booking', :booking => booking %> <% end %> I get (correct) 2012