Hi,

The best method is the ActiveRecord relationship.

In the users model you place the code has_many :programs and in the progrm model put this belongs_to :users
So, in the controller you can use the find method with parameters.

I hope this help you!

On Feb 24, 2011, at 9:56 AM, Danielle B. wrote:

Hi guys,

Just wondering if anyone can help me, im quite a newbie to ruby. i have
developed an application(Fitness site) which allows users to register
and obtain a free fitness programme based on the info they have entered
when registering. this is were my problem lies i need to connect the
fitness programme to the users table in the database and use some sort
of algrothim to select the correct fitness programme for them based on
the age they entered when registering. any ideas??


link to website http://funkyfitness.heroku.com/

--
Posted via http://www.ruby-forum.com/.

--
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 rubyonrails- [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 .


--
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.

Reply via email to