On 11 November 2011 12:02, Mahmoud Abdel-Fattah
[email protected] wrote:
I’m totally rails newbie, and just started it a couple of days ago
moving from PHP, so I’ve the following query, and want to know how can
I do it using ActiveRecord
sites.id = ‘1’
Don’t think about queries, think about relationships. If you setup
the has_many and belongs_to relationships then if you have a Site in
@site then its snapshots are @sites.snapshots and for a given snapshot
then its technologies are snapshot.technologies. Let Rails worry
about the queries.
Any newcomer is well advised to work through some tutorials to
understand what rails can do. railstutorial.org is good and is free
to use online. Also work through the Rails Guides.
Make sure any tutorial you use is for the right version of Rails.
You received this message because you are subscribed to the Google G. “Ruby
on Rails: Talk” group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
For more options, visit this group at