Displaying 1 result from an estimated 1 matches for "director_dropdown".
2006 Apr 04
3
newbie - HABTM problems writing to Join Table in SQL
...ull => false
end
end
------director.rb-----
class Director < ActiveRecord::Base
has_and_belongs_to_many :films
end
------film.rb-------
class Film < ActiveRecord::Base
has_and_belongs_to_many :directors
end
--------application_helper.rb---------
module ApplicationHelper
def director_dropdown
select(:director, :id, Director.find(:all, :order => "name").map {|d|
[d.name, d.director_id] })
end
end
--------films/form.rhtml-----------
<p><label for="film_title">Title</label><br/>
<%= text_field ''film'', ''ti...