Topic: dependencies [SOLVED]

I have accounts and users
a user has to belong to a account

in my model i have

class User < ActiveRecord::Base
belongs_to :account

and
class Account < ActiveRecord::Base
has_many :users

but when i going to the console "rails c"

and i do User

how do i also get there account info?



Thanks

Last edited by moiseszaragoza (2012-06-07 16:47:02)

Re: dependencies [SOLVED]

ok on the command line i got

User.first.account

on a view

<%=  user.account.name  %>

Last edited by moiseszaragoza (2012-06-07 16:38:22)