Hi All,
Newbie here working with an existing Rails project. I'm trying to create a
method that will return a simple string of object values.
I have an app that has companies that each are assigned to one or more
branches. Then I have a contact who is assigned to a company. I've created an
association with belongs_to for both the company and branch, and the branch and
company has their own class in AR.
So
def get_company_branches
my_branches = self.company.branches
my_list = my_branches.each { |x| puts x.branch_name }
return my_list
end
For some reason this returns an object id (the raw ruby object id I think) not
the string i am looking for. Any suggestions?
Best,
Peter
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.