<p>I am wanting to use ActiveScaffold to create <em>assignment</em> records for several <em>students</em> in a single step.  The records will all contain identical data, with the exception of the student_id.</p>

<p>I was able to override the default form and replace the dropdown box for selecting the student name with a multi-select box - which is what I want.  That change however, was only cosmetic, as the underlying code only grabs the first selected name from that box, and creates a single record.</p>

<p>Can somebody suggest a good way to accomplish this in a way that doesn't require my deciphering and rewriting too much of the underlying ActiveScaffold code?</p>

<hr>

<p>Update: I still haven't found a good answer to this problem.</p>

[{'answer_id': 60366, 'author': 'Can Berk Güder', 'author_id': 2119, 'author_profile': 'https://Stackoverflow.com/users/2119', 'pm_score': 0, 'selected': False, 'text': '<p>if your assingnments have <code>has_many :students</code> or <code>has_and_belongs_to_many :students</code>, then you can change the id of the multi-select box to assignment_student_ids[], and it should work.</p>\n'}, {'answer_id': 62533, 'author': 'Brent ', 'author_id': 3764, 'author_profile': 'https://Stackoverflow.com/users/3764', 'pm_score': 0, 'selected': False, 'text': '<p>I was referred to <a href="http://code.google.com/p/activescaffold-ext/wiki/BatchCreate" rel="nofollow noreferrer">BatchCreate</a>, an ActiveScaffold extension which looks like it might do the trick.</p>\n'}, {'answer_id': 295986, 'author': 'ARemesal', 'author_id': 36599, 'author_profile': 'https://Stackoverflow.com/users/36599', 'pm_score': 1, 'selected': False, 'text': '<p>I suppose you have defined your multi-select box adding :multiple => true to html parameters of select_tag. Then, in the controller, you need to access the list of names selected, what you can do like this:</p>\n\n<pre><code>params[:students].collect{|student| insert_student(student, params[:assignment_id]) }\n</code></pre>\n\n<p>With collect applied to an array or enum you can loop through each item of that array, and then do what you need with each student (in the example, to call a function for insert the students). Collect returns an array with the results of doing the code inside.</p>\n'}]
['https://Stackoverflow.com/questions/60019', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3764/']