I'm designing an application that has products and suppliers. Single
product has_many suppliers and each supplier has unique supplier code
for each product.
The form would facilitate something like
1. Select supplier from the list --> 2. Type the supplier code related
to supplier in the text field
The supplier codes can be added dynamically.
class Product < ActiveRecord::Base
has_many :suppliers, :through => :supplier_codes
class SupplierCode < ActiveRecord::Base
class Supplier < ActiveRecord::Base
has_many :products, :through => :supplier_codes
The supplier_code table has these columns
I'm stuck with developing controller and form. trying out many things
but no success so far. Any help welcome.