+ if @rentable.checkedout?
+ flash[:error] = "This #{@rentable.type} is already checked out!"
+ redirect_to :action => :rent_begin
+ return
+ end
+
+ # Check out the item
+ checkout = Coitem.new
+ checkout.customer = @customer
+ checkout.rentable = @rentable
+ checkout.out_date = Time.now.to_date
+ checkout.due_date = @rentable.due_date
+ checkout.save!
+