Displaying 1 result from an estimated 1 matches for "title_control".
2006 Jun 29
2
HABTM with multiple select list
...am very new to ruby and need to create my first HABTM with multiple
select list.
 I am having problems saving data in the middle(linking) 
table.
 1. titles can have multiple categories 
 2. categories can have multiple titles
Categories, titles and categories_titles tables are created.
 ----- title_controller.rb--
  def new
    @title = Title.new
    @categories = Category.find(:all, :order
=>"name")
    @category_ids = []
    @title.categories.each { |x| @category_ids <<
x.id }
  end
  def create
    @title = Title.new(params[:title])
    @title.categories &am...