On Sep 5, 2013, at 9:47 AM, honey ruby <emailtohoneyruby@gmail.com> wrote:
> Hi all
>
> I have two tables A and B
> I have saved a record in table A and I want to save the id of that record in table B. How Can I do that.
> Well I can do by search of same params which I save in Table A but I feel it is not that good approach.
Just save it, then use the id ;-)
Seriously, this is a very common idiom, and you'll find that rails takes care of it.
--
Scott Ribe
scott_ribe@elevated-dev.com
http://www.elevated-dev.com/
(303) 722-0567 voice
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/AF6ACC83-B9B1-45A6-A740-B8D4C9CFAECE%40elevated-dev.com.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment