Oh,
I think you are misled because my syntax is perhaps wrong,
but I did mention in my original question that 'book'
is a field of ProjectItem. There is no 'Book' model.
So, in class ProjectItem I have a field 'book'.
Each ProjectItem record will have a book field. Many books will have
an identical name. I wish to make a list that is comprised
of book names, of which each member of the list is a unique
example of that book name. So there is no belongs_to or
has_many relationship going on. I want this list of unique
examples of book names to be sorted in ascending order.
When I am creating this instance:
@books = ProjectItem.find_books
It would actually be a @project_items list, which to my
understanding should only consist of @project_items.book data,
since I believe :select => "DISTINCT(book)" only returns the data
from that particular field (book) and not all the other data.
1)That is what I understand. If I am wrong on this, would like to
know where.
2) I thought when I use 'name' in the following:
@books.each do |name|
link_to ( #{name.book} )
...that 'name' is a symbol only, and just used as a placeholder
which
is just substituted for each member of the array. If that is
correct,
then the above would just iterate through for each
project_item.book
and output a link to it. And @books is a var which actually is
an instance of @project_item. Part of reason for this posting
is to see if my assumptions are correct and I do have freedom
to name instance to something different than the standard
approach.
Perhaps using a standard naming approach would have increased
the
clarity.
Jet
On Nov 22, 1:56 pm, Rick DeNatale <
rick.denat...@gmail.com> wrote: