Michael Imstepf
2012-Sep-30 18:56 UTC
Rails 3: create input field for each element of a collection (MongoID)
Hi all, I have two models, Item and Bid class Item> include Mongoid::Document > field :name, type: String > has_many :bids > end > class Bid > include Mongoid::Document > include Mongoid::Timestamps::Created > field :bid, type: Float > belongs_to :item > endIn views/prices/index I would like to list all items in a table and for each item put a field next it in which people can enter a number. At the bottom of the form should be a submit button for all records. How is this best achieved? There''s plenty of code out there explaining how to add, for instance, several questions to one survey<http://railscasts.com/episodes/196-nested-model-form-part-1>but I couldn''t find an example that shows how to add one new record for each of of an existing element of a collection. Thanks... -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/adUQnc0M9R8J. For more options, visit https://groups.google.com/groups/opt_out.