Comments (3)
On the previous lighthouse ticket, Josep M. Bach made the following comment:
February 27th, 2011 @ 02:01 PM
Seems that the builder doesn't know it's a one-to-many relationship or something like that, could it be?
In this particular line it checks for the [] naming after person[phones] - if it had found it, it would have triggered the #retrieve_auto_index method, which assigns an index ([0], [1]...). Sadly it matches nothing, so I'm guessing somewhere in the call stack it's not checking if person->phones is a 1-n relationship.
Any ideas?
from rails.
Why don't you add accepts_nested_attributes_for :phones
to Person
class? Then fields_for
will add [0]
to input names as you expect.
fields_for
explicitly checks for existence of phones_attributes=
method: https://github.com/rails/rails/blob/v3.0.7/actionpack/lib/action_view/helpers/form_helper.rb#L1159-1164
from rails.
cheers!
fwiw I had put the accepts_nested_attributes in there back in 3.0.5 and it didnt work, but apparently in 3.0.7 everything works as expected. Thanks again
from rails.
Related Issues (20)
- Rails logs error messages with huge stack trace that I can't silence HOT 2
- `ActiveRecord::Migration[7.0]`'s `rename_table` uses 7.1's new truncated index name format HOT 1
- ActiveStorage::FileNotFoundError (ActiveStorage::FileNotFoundError) HOT 1
- Segmentation Fault on Docker and ruby 3.3.0 HOT 4
- Credentials usage doesn't agree with the code HOT 1
- Add `jsonb` on sqlite connection adapter table definition HOT 1
- How to use Azure Managed Identity for authentication and authorization for Ruby On Rails Active Storage?
- `ActionView::Template::Error`: Missing Active Model partial when rendered from Controller declared in module HOT 2
- O(N^2) operation in `CollectionAssociation#replace_common_records_in_memory` and **another** O(N^2) operation in `ActiveStorage::Attached::Many#attach`
- belongs_to association doesn't work with composite `primary_key` option HOT 4
- Video analyzer does not detect rotation of HDR videos
- eager_load, includes load wrong data using composite primary keys and query_constraints HOT 2
- Comparing `Time` object with an integer doesn't throw an error HOT 2
- Running "bundle exec rake rdoc" more than once does not work HOT 2
- `ReferenceError: File is not defined` HOT 1
- Incorrectly raising `ReadonlyAttributeError` when autosaving `has_one` association with readonly foreign key HOT 4
- Allow comments on `railsrc`. HOT 2
- Make it possible to skip CSS when generating APIs, or bring the possibility to skip entire `railsrc` or template files. HOT 1
- Command rails server fails if all db configs have database_tasks: false HOT 5
- Unexpected controller prefix path de-duplication in view partial lookup paths HOT 2
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 rails.