Comments (8)
It might be good to mention in the readme the need for :allow_destroy => true in the accepts_nested_attributes_for call.
from nested_form.
That's strange, I'm not sure what the issue could be. Do you have attr_accessible in the image model? You can try adding _destroy
there but you shouldn't have to.
You can check out the nested_form branch of the complex-form-example project for a working example.
https://github.com/ryanb/complex-form-examples/tree/nested_form
from nested_form.
How can I debug "the model" to find the problem? I use the following in the parent model:
attr_accessible ..., :avatars_attributes
has_many :avatars, :as => :avatarable, :dependent => :destroy
accepts_nested_attributes_for :avatars, :allow_destroy => true
[SOLVED] Problem solved. I have moved the code above to the superclass. If the code is in the subclass model than the destroy doesn't work!
from nested_form.
Glad you got it solved, that's a strange bug but thank you for reporting.
from nested_form.
Good point. I'll reopen this for that readme addition.
from nested_form.
i had the same problem in rails 3.1.0.rc8 - but to add :allow_destroy => true does the trick - also today in rails 3.1 …
thanks for this gem :)
from nested_form.
See pull request 88 for the readme update.
from nested_form.
#88 was merged. Thanks!
from nested_form.
Related Issues (20)
- Can I add different subform (using STI)? HOT 3
- Remove labels
- Cusomized forms
- link_to_add make large index number
- wrong field name for the nested _destroy field
- Incremental counter for nested fields HOT 2
- nested_form shows extra fields after error messages HOT 1
- -
- Limit how many nested_attributes can be added? HOT 1
- undefined method `capture_position=' for nil:NilClass HOT 1
- link_to_remove is not deleted vale only hide that so when we update that send hide value in parmeter HOT 1
- nested_form for recursive Model HOT 1
- on clicking link_to_add nested forms not shown in rails HOT 1
- Sort nested form in edit view based on column HOT 1
- Bootsy wysiwyg editor not supported for nested forms HOT 3
- reject_if if 2 attributes are blank HOT 2
- Callbacks nested
- Link to remove not working as expected when :nested_wrapper is false HOT 1
- When I cleck on <%= f.link_to_add "Add a Step", :steps %>, nothing happens.
- Link_to_add, data: { target: } not working for a bootstrap modal pop up HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nested_form.