[Rails] Re: Foreign keys in order to send email
Colin Law wrote in post #1050562:
> On 7 March 2012 13:43, Christopher Jones <lists@ruby-forum.com> wrote:
>> associate the relationship between the two which is every game needs an
>> users email to be sent to?
> Assuming you have specified user has_many games and game belongs_to
> user then if you have a game you can access the game's user by
> game.user, so you can access the users email by game.user.email.
>
> Have a look at the Rails Guide on ActiveRecord Associations (and the
> other guides too). As it seems you need to learn about Rails basics I
> suggest that you work right through a tutorial such as
> railstutorial.org (which is free to use online). But wait, have I not
> suggested this to you on at least one previous occasion? Have you
> done that? Am I wasting my time I wonder?
>
> Colin
Hey Colin I have been working through a lot of tutorials, Mainly ones
associated with the book Agile Web Development with Ruby on Rails as
well as general ones of Railstutorial.org. I am just getting used to the
whole idea of rails at the moment. It takes me a while to catch on with
programming languages.
Sorry if this is an inconvenience.
--
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-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home