similar to: many-to-many error

Displaying 20 results from an estimated 2000 matches similar to: "many-to-many error"

2006 Jul 30
1
Doubt on composite index
The AWDwR book has the following: add_index :categories_products, [:product_id, :category_id] add_index :categories_products, :category_id The first, composite index actually serves two purposes: it creates an index which can be searched on both foreign key columns, and with most databases it also creates an index that enables fast lookup by the product id. The second index then completes
2006 Jun 05
5
adding habtm through migrations
Hello, I''m stuck, I''ve got a model Product and would like to add a new model called Category. Furthermore, I want to set up a many2many relationship between the mentioned models. the problem is that I do not know how to set the primary key in the categories_products table. this is what I''ve got in my migration file: create_table :categories do |t| t.column :name,
2006 Jun 14
3
Prevent duplicate HABTM associations
Hi, I am trying to restrict duplicate has_and_belongs_to_many associations. I tried to find support for a association validation for duplicates but couldn''t find anything. I understand I could use :uniq=>true on the model association but this would only prevent it from displaying duplicates, I want to stop duplicate associations being inserted in the first place. I have a vague
2006 May 03
3
Sorting by multiple categories
I have a database with a field called ''category''. ''category'' contains the categories separated by a "," i.e. 1, 2, 5 I know with something like: @products = Product.find(:all, :condition => "category = ''1''") I could get some results if any of the ''category'' fields only contained "1" but
2006 Jul 15
4
updating multiple records with form
I have an app that has two models -- products and details. I''m building a form that allows a user to create a new product and specify a description, etc. The form needs to allow for creation of multiple items in the details model/table. for example, I have a block of form items that collect info for the men''s version of the product -- inventory count for each size, etc. And
2006 May 04
2
Building a FAQ
I''m new in Rails, and I''m building my first application. I''m trying to make a FAQ for this application, organized by product (questions about each product) and category (questions of different categories or topics), and there is something I can''t figure it out how to do. I have these tables: create_table "faqs" do |t| t.column "question",
2006 May 28
7
Join table not being populated
Hello, I have the usual Categories and Products table scenario, mediated by a Categories_Products join table. When I create a new Product and into a given Category, I notice that my join table is not being populated. Shouldn''t the join Categories_Products table be populated? Thanks, gk -- Posted via http://www.ruby-forum.com/.
2009 Jun 22
5
has_many through , or habtm , using form
i think there ara two ways of relate products and categories , basically i want to fix one product(e.g hp dv7....) to some categories (notebook,17"notebooks...) i made a table named categorization(incuding category_id,product_id fields) then in models i write these codes below class Product < ActiveRecord::Base has_many :categories, :through => :categorizations
2012 Sep 13
10
access key error
I am getting following error while run my rails app in my server ActionView::Template::Error (You did not provide both required access keys. Please provide the access_key_id and the secret_access_key.): -- 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
2005 Jun 03
1
sorting on a habtm relationship
I have two tables ("products" and "categories") that have a has_and_belongs_to_many relationship, and I need to be able to arbitrarily sort products in the scope of a category using something like acts_as_list. Problem is, since each product can belong to multiple categories, it doesn''t work to use acts_as_list and have the "position" field be in the
2005 Aug 15
0
RE: has_many_belongs_to_many insert issues [CLOSED]
Found the issue. In the association table (categories.products) it is very important to use lowercase column names. I.e, product_id and category_id. I had Product_id and Category_id in SQL.... Gildas -----Original Message----- From: rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org [mailto:rails-bounces-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org] On Behalf Of Cherruel,
2006 Jul 06
2
Validation Error
Hi all, I''m trying to validate a data field. I''ve added ''validate_presence_of :name'' to the record model, but when I try to create a record i get an error complaining that it can''t find data from another table that also is updated on that page. Let me explain further, On my ''record'' update page, I have data from another table
2006 May 01
4
Find rows with associations in habtm
This may have been asked/answered before - if so, i apologise... I have the following table layout in a habtm relationship: ------------ ----------------------- -------------- | products | ----| categories_products |-----| categories | ------------ ----------------------- -------------- What would be the best way to pull out all the products for a given category? At the
2006 Mar 01
1
question
Hello all! I would like to get an admin interface for my shopping cart app up and running using rails. The admin interface will be used for Customers, Products, Catggories, ect management. My db schema reflects the above mention tables names. The question I have is could I use the scaffold feature this way: (eg)---ruby script/generate scaffold Products Customers Categories Admin?
2006 Jan 15
6
Saving one-many associations (elegant solution please)
What is the most elegant way to save new one-many associations? order = Order.new(:name => "My Order") order.line_items << LineItem.new(:product_id => 1, :quantity => 2) order.line_items << LineItem.new(:product_id => 2, :quantity => 5) order.save The above - which is by far the most elegant way of putting it - doesn''t work for me - the line_items
2003 May 24
2
advantages of a sip phone over Wildcard TDM400P solution
Hi, after finally getting my testsystem to work well I'm planning to buy some hardware. Now I was wondering what the advantages / disadvantages of using a Wildcard TDM400P solution over using real sip phones like the snoms is? The only thing I came up with is that the Snoms can use a LDAP adressbook on the server. What about calling a sip adress like person@server.com. Can this be done by
2007 Jan 25
6
NOT FOUND error
I''ve been hunting the web and reading the mailing lists all day but I''m not finding any guidance on this problem. When I try to talk to my mongrel it simply responds with NOT FOUND and nothing else. I can''t find anything on google because this has to be the second most commond phrase in existence. Any help or guidance would be greatly appreciated. Sincerely, Chuck Vose
2008 Aug 24
3
R project web site
Is anyone else encountering trouble viewing the basic www.r-project.org page? Or has it been changed recently so that google hasn't kept up? I find I can access the mirror of the CRAN page at http://www.maths.bris.ac.uk/R/, none of the *.org pages. Nor can I jump to the R homepage from the CRAN mirror. JWDougherty
2008 Jun 10
5
Rails params parsing bug?
I have a form that sends the following query string to my Rails controller: transaxion[category_association_attributes][][category_id]=2& transaxion[category_association_attributes][][amount]=12& transaxion[category_association_attributes][][category_id]=1& transaxion[category_association_attributes][][amount]=8 But ActionController parses it as:
2006 Sep 28
15
Inserting rows into linking table
Hi, I have two objects: Contacts Lists I want to be able to add multiple contacts to multiple lists. I''ve created a linking table and a form that allows me to select the contacts using checkboxes, but I''m having some problems with the controller and model. I receive the following error message when I submit the form: Mysql::Error: Cannot add or update a child row: a