> The directory has a few pieces.
> * The photo directory is sorted by group
> * The appendix is sorted by last name
> I want the appendix to show the page number on which the person is
> printed, but I don't want to store that in the database.
An activerecord object is a normal ruby object - it can have non
database store instance variables if you want.
but when I do this:
contact.page_number = page_number
where page_number doesn't exist in db/migrate/001_create_contacts.rb
or app/model/contacts.rb
I get this:
undefined method `page_number=' for #<Contact:0xb6bbb5b4>
Don't understand this.
As I understand it if you have
attr_accessor :my_var
then @my_var will access the variable (but this may only be written
inside the class)
and my_var is a method (well two methods actually) that may be used
externally to read/write to @my_var so you can say
my_object.my_var = 1
x = my_object.my_var
If you use my_var (no @) inside the class this should work but it is
calling the accessor methods rather than directly accessing @my_var