Hi,

yes, your guess is correct.

--
Volker

On Mar 24, 11:06 pm, ruinen <[email protected]> wrote:
> I am running Rails 2.3.11 and the latest ActiveScaffold master branch.
> I tried  active_scaffold_batch but got the error
>
>    `load_missing_constant': uninitialized constant ActionDispatch
> (NameError)
>
> ... so I guess it definitely requires Rails 3.
>
> On Mar 23, 12:42 pm, vhochstein <[email protected]> wrote:
>
> > Hi,
>
> > if you are using activescafffold for rails 3 you might as well think
> > about using active_scafffold_batch plugin.
> > It includes a batch_create action which allows you to do the
> > following:
>
> > Assume you have the following relation:
> > Project has many tasks.
>
> > You want to add a new milestone task to several projects and the tasks
> > are always identical just the project attribute differs.
>
> > --
> > Volker
>
> > On Mar 22, 7:41 am, Hernan Astudillo <[email protected]> wrote:
>
> > > you might override the "do_create" method in the controller.
> > > Use the one at lib/active_scaffold/actions/create.rb and change it as
> > > needed.
>
> > > On Mon, Mar 21, 2011 at 8:55 PM, ruinen <[email protected]> wrote:
> > > > I am trying to use ActiveScaffold to create multiple records at once.
> > > > I have a successfully used Form Overrides (https://github.com/
> > > > activescaffold/active_scaffold/wiki/Form-Overrides) to change a HTML
> > > > SELECT to allow multiple selections:
>
> > > > module TrainingsHelper
> > > >  def unit_form_column(record, options)
> > > >    select :record, :unit, Unit.find.collect { |item| [item.title,
> > > > item.id]}, options, {:multiple=>true}
> > > >  end
> > > > end
>
> > > > When I select multiple options and click 'Create' I get an expected
> > > > error, since I am now submitting an array for one of the fields where
> > > > a single value is expected.
>
> > > > Processing TrainingsController#create [POST]
> > > >  Parameters: {"authenticity_token"=>"xx", "record"=>{"unit"=>["124",
> > > > "125", "126"], "comment"=>""}, "commit"=>"Create", "eid"=>"xx",
> > > > "nested"=>"true", "parent_column"=>"trainings",
> > > > "parent_model"=>"User", "controller"=>"trainings", "action"=>"create"}
> > > >  User Load (1.0ms) SELECT * FROM `users` WHERE (`users`.`id` = '4')
> > > > LIMIT 1
> > > >  Unit Load (0.0ms)  SELECT * FROM `units` WHERE (`units`.`id` IN
> > > > (124,125, 126))
> > > > ActiveRecord::AssociationTypeMismatch (Unit(#18426) expected, got
> > > > Array(#15772)):
>
> > > > I was hoping that I could use the before_create_save [controller
> > > > method] or before_validation [model callback] to do something like
> > > > pick up the 'unit' array and create the additional records (i.e. 125 &
> > > > 126) and then just set unit to 124 so final record can get saved
> > > > normally. However the error occurs before i hit the before_create_save
> > > > or before_validation. Is there anything else I can try?
>
> > > > --
> > > > You received this message because you are subscribed to the Google 
> > > > Groups
> > > > "ActiveScaffold : Ruby on Rails plugin" group.
> > > > To post to this group, send email to [email protected].
> > > > To unsubscribe from this group, send email to
> > > > [email protected].
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/activescaffold?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.

Reply via email to