Ruby on Rails Wednesday, April 28, 2010

Sharagoz wrote:
> On Apr 28, 11:14 am, Fearless Fool <li...@ruby-forum.com> wrote:
>> I can create, view, edit, delete Users without trouble. But I'm
>> conceptually stuck on how to create Locations. Since Users has_many
>> Locations, I need to stuff the user_id into a Location when I create it.
>
> I encourage you to check out Ryan Bates' episode on nested resources:
> http://railscasts.com/episodes/139-nested-resources

@Sharagoz:

I don't generally like webcasts (I personally find reading an easier way
to absorb info), that was very helpful and got me 85% over the hump.
The last 15% was courtesy of Adam Wiggins in:

http://adamblog.heroku.com/past/2007/12/20/nested_resources_in_rails_2/

Without that bit, I would not have known that form_for requires
([parent_id, child_id]) ... as its first arg. Now I know.

And (best of all) it's all working. Thanks!

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

No comments:

Post a Comment