Help with associations

I'm new to RoR and databases in general. Here is my problem.

I have "Lists" and "Items". Instead of using a join table and a habtm
relationship, I created a third model so I can hold additional data in
it. It's called "Listitems". I want to be able to display only the
"Items" that have not yet been added to the certain "List".

I have:

class List < ActiveRecord::Base
  has_many :listitems, :dependent => true
  has_many :items, :through => :listitems

class Item < ActiveRecord::Base
  has_many :listitems, :dependent => true
  has_many :lists, :through => :listitems

class Listitem < ActiveRecord::Base
  belongs_to :list
  belongs_to :item

What kind of query should I be writing in my controller to get the
results I want.

Untested, but I think that should do it:

  class List
      select * from items
        where not exists
          (select * from list_items.item_id = and
list_items.list_id = ?)
    # Get all items that do NOT belong to this list.
    def other_items
      Item.find_by_sql [OTHER_ITEMS_SQL,]

I think I'm still misunderstanding. I read the blogpost and tried

class List < ActiveRecord::Base
  has_many :items, :through => :listitems do
    def not
      find(:conditions => [" != ?",])

I then try looping through

<% for item in @list.items.not %>
  <% %>
<% end%>

I get the error "Couldn't find Item without an ID"

I ended up using in my view:

<% for item in @items %>
  <% unless @list.items.include?(item) %>
             [CODE] etc etc etc

It's messy, but it seems to work