Topic: Dynamic Rails Drop down combo boxes

Hello,

I've been pulling my hair out trying to figure this out with rails, and I'm hoping somebody can help me here.  I need helping in creating a dynamic rails drop down box for users to properly enter a car's make and model.  For example, the user is to enter Toyota Camry and not Toyota Civic.  This is what I have:

Car table
ID
Model
Make


def new
  @carsmake = Car.find( :all,
                          :order => "make",
                          :group => "make").map {|c| [c.make] }


  @carsmodel = Car.find( :all,
                              :conditions => ["make = ?", @carsmake],
                              :order => "model").map {|c| [c.model] }
end
 

Autos View (new.rhtml)
<% form_for :auto, :url => autos_url, :html => { :method => :post } do |f| -%>
    <p>Make:<br />
      <%= select(:car, :make, @carsmake) %>
    <p>Model:<br />
      <%= select(:car, :model, @carsmodel) %>
 
  <%= observe_field("model",
    :frequency => 0.25,
    :update => "model_container",
    :url => { :action => :autos_url },
    :with => "'carmake='+value") %>



I know I'm completely off here.  Here's my logic, so I'm hoping to learn from mistake.
1.  @carsmake will get all the unique makes out of my database.
2.  I'm hoping that after the user selects the @carsmake from the select statement in the view, that value will assigned to @carsmake.  So if I user wants Toyota, then @carsmake='Toyota'.
3.  The Javascript will then query the database where all the makes = 'Toyota' and it'll return the model names.


I'm new to rails, but I'm learning.  There isn't any good example for this.  I did this all in 1 table, but I'm wondering if it should have been 2 tables.  I'd appreciate any feedback and sample code if possible. I learn by example.  Many thanks in advance.