I think I am going blind, because I cannot find what is wrong with the
following. The bad thing is that I had it working, made couple of
changes, reverted back to the original, now it doesn't work.
I have been trying to figure out why this isn't working way too long,
to the point my vision is blurring.
This invocation will generate a select tag name="task[category_id]" with
options of form <option
value="category.id">category.<some_category_attribute></option>. The
option with category.id == user.category_id will be selected.
Now, I'm guessing the following from you previous e-mail:
task belongs_to category
category has_many tasks
Thus, I'm seeing the following relationship:
class Task < ActiveRecord::Base
belongs_to :category
end
class Category < ActiveRecord::Base
has_many :tasks
end
Please note that Task model contains the foreign key, 'category_id',
because it has the belongs_to declaration.
Since I am just playing around with things I am constantly re-
formatting how things are arranged on the screen. How this is
supposed to work, is that at the top of the screen there is a select
list containing the categories, that combined within the button beside
it, allows the user to easily view the todo's for each of the
categories.
So the select control that I am having problems with isn't yet, at the
time of the problem, related to the tasks just yet. I want to fill
the select control with all the categories that exist in the database.