Hello,
I need some help please.
I have two tables:
accounts
id
name
accdesc_id
accdescs
id
accountdescription
An account can only have one accountdescription but a description can
have many accounts.
I have created two models: account & accdesc
for account I have:
has_one :accdesc
and for accdesc:
belongs_to :accounts
Is this correct? It might be causing the other problem I have …
I want to use paginate to create a list of accounts with their type i.e
do a join between the two. I thought rails did this stuff for me but I
can’t get it to work.
@account_pages, @accounts = paginate :accounts, :per_page => 10
How do I get to the accountdescription please?
Also how do I cast an integer into a string? I have some very complex
SQL I need to run out of find_by_sql and the id is held in
session[‘userid’].
I have googled for all the answers but I haven’t found anything.
Thanks!!