On Lunes, 12 de Abril de 2010 15:56:47 scrozier escribió:
> Thank you, Sergio. Getting closer. Now I'm getting this (below). I
> will see if I can get anywhere with this, but wanted to get this
> posted right away.
Try adding :nested => true to params too
>
> Thanks again,
>
> Steve
>
> Processing Admin::DiplomasController#destroy_existing (for ::1 at
> 2010-04-12 08:35:52) [DELETE]
> Parameters: {"eid"=>"96d58316c473e2f24db9c53a79cf268f",
> "parent_column"=>"diplomas", "action"=>"destroy_existing",
> "_method"=>"delete", "id"=>"5536", "parent_model"=>"Diploma",
> "controller"=>"admin/diplomas"}
>
> ActiveRecord::RecordNotFound (Couldn't find Diploma without an ID):
> vendor/rails/activerecord/lib/active_record/base.rb:1567:in
> `find_from_ids'
> vendor/rails/activerecord/lib/active_record/base.rb:616:in `find'
> vendor/plugins/active_scaffold/lib/active_scaffold/finder.rb:173:in
> `find_if_allowed'
> vendor/plugins/active_scaffold/lib/active_scaffold/actions/nested.rb:
> 198:in `do_destroy_existing'
> vendor/plugins/active_scaffold/lib/active_scaffold/actions/nested.rb:
> 108:in `destroy_existing'
> vendor/rails/actionpack/lib/action_controller/base.rb:1331:in `send'
> vendor/rails/actionpack/lib/action_controller/base.rb:1331:in
> `perform_action_without_filters'
> vendor/rails/actionpack/lib/action_controller/filters.rb:617:in
> `call_filters'
> vendor/rails/actionpack/lib/action_controller/filters.rb:610:in
> `perform_action_without_benchmark'
> vendor/rails/actionpack/lib/action_controller/benchmarking.rb:68:in
> `perform_action_without_rescue'
>
> > parent_model and parent_column parameters are missing in the action
> > links. When you use nested scaffolds are added automatically by nesting
> > code, but when you use embedded scaffolds you must add them in :params
> > option of render
> >
> > :active_scaffold, like :params => {:parent_model => 'Diploma',
> > : :parent_column
> >
> > => 'diplomas'}. In your code try with:
> >
> > <%= render :active_scaffold => "admin/#{section}", :label =>
> > tab_label(section), :constraints => { con_name => @record.id }, :params
> > => {:parent_column => section, :parent_model =>
> > section.singularize.camelize} %>
--
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [email protected]
--
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.