Hi

When creating a new product and assigning the categories it belongs to (via
a multi select) the records are not getting added into my join table
(category_id, product_id) but the product details are getting saved to the
product table just find. Do I need to do anything extra for the joining
table or should rails work this out for me?

Thanks

Alan

--
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/d44a2111-602d-4fdb-9836-d5c2e3cc6b28%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Frederick Cheung at Nov 21, 2013 at 10:53 pm

    On Thursday, November 21, 2013 12:28:18 PM UTC, Alan Tucker wrote:
    Hi

    When creating a new product and assigning the categories it belongs to
    (via a multi select) the records are not getting added into my join table
    (category_id, product_id) but the product details are getting saved to the
    product table just find. Do I need to do anything extra for the joining
    table or should rails work this out for me?
    What precisely are you doing?

    Fred
    Thanks

    Alan
    --
    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/e5e875f2-5df8-4ef5-aacf-a5a95b6f7ce4%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Colin Law at Nov 22, 2013 at 7:38 am

    On 21 November 2013 12:28, Alan Tucker wrote:
    Hi

    When creating a new product and assigning the categories it belongs to (via
    a multi select) the records are not getting added into my join table
    (category_id, product_id) but the product details are getting saved to the
    product table just find. Do I need to do anything extra for the joining
    table or should rails work this out for me?
    You need to show us the relationships you have defined between the
    models (has_many, etc) and the code you are using to save the records
    (not the whole application, just the code saving the data). Also
    useful is the contents of the log for the POST operation, showing the
    parameters passed. Examine this carefully yourself first, however,
    and possibly put some debug code in to try and work out what is
    happening. You can insert puts statements in the code and these will
    appear in the server window.

    Colin
    Thanks

    Alan

    --
    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/d44a2111-602d-4fdb-9836-d5c2e3cc6b28%40googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
    --
    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/CAL%3D0gLvLUVRMMmTs%3DR4wDKFfAmcHgU5xmSU30iBOkYJfcQ5n2w%40mail.gmail.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedNov 21, '13 at 10:51p
activeNov 22, '13 at 7:38a
posts3
users3
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2022 Grokbase