Hi all,
Im working on a copy contact info into project method. Nosing aroundwith
IRB I
see a hex value. Named Contact:0x40ca01cc
#<Contact:0x40ca01cc @attributes={“name”=>“GP-net”, “id”=>“7”,
“lastname”=>“Petersen”, “firstname”=>“Gerard”}>
Why is it there like that and not in a human readable way?
– Method:
@project = Project.new
@project_contact = ProjectContact.new
@contacts_list = Contact.find_by_sql(‘select t1.name, t2.firstname,
t2.lastname, t2.id from companies AS t1, contacts AS t2 where t1.id =
t2.company_id order by t1.name’)
@project_contacts = @contacts_list.collect { |c| [ c.name + " - " +
c.firstname + " " + c.lastname, c.id ] }
render_action ‘edit_project’
– Models:
class Project < ActiveRecord::Base
has_one :project_contact
has_many :project_products
end
class ProjectContact < ActiveRecord::Base
belongs_to :project
end
class ProjectProduct < ActiveRecord::Base
belongs_to :project
end
“Who cares if it doesn’t do anything? It was made with our new
Triple-Iso-Bifurcated-Krypton-Gate-MOS process …”
My $Grtz =~ Gerard;
~
:wq!