Comments (5)
this issue is actually FormData
doing a join or something on the array. as you can see here https://github.com/funtusov/ember-cli-form-data/blob/master/addon/mixins/form-data-adapter.js#L35 you are just passing the value in. but FormData reformats it. I am not really sure what the work around is for this.
2 separate requests?
from ember-cli-form-data.
Hey @koryteg thanks for filing an issue! Could you please copy the exact request that gets sent in your case and specify the version of ember-data that you're using?
from ember-cli-form-data.
I am using ember data 1.13.8
from ember-cli-form-data.
I have a slug: attr('string')
attribute with a value of asdf!
. Here's how it looks in the payload (disableRoot: true
):
------WebKitFormBoundaryIeH9hzmqnKbfDBnN
Content-Disposition: form-data; name="0"
a
------WebKitFormBoundaryIeH9hzmqnKbfDBnN
Content-Disposition: form-data; name="1"
d
------WebKitFormBoundaryIeH9hzmqnKbfDBnN
Content-Disposition: form-data; name="2"
s
------WebKitFormBoundaryIeH9hzmqnKbfDBnN
Content-Disposition: form-data; name="3"
f
------WebKitFormBoundaryIeH9hzmqnKbfDBnN
Content-Disposition: form-data; name="4"
!
------WebKitFormBoundaryIeH9hzmqnKbfDBnN--
With disableRoot: false
names are slug[0]
, slug[1]
...
from ember-cli-form-data.
The cause of the problem is that here:
hash.data = this._getFormData(data);
data
is a hash of record attributes, while the addon seems to expect it to be a hash of hashes (unnecessary Object.keys(data[root]).forEach
).
PS Ember Data 2.7.
from ember-cli-form-data.
Related Issues (17)
- `hash` is `undefined` in `ajaxOptions` HOT 5
- Empty file being uploaded HOT 11
- How to update thumbnail preview HOT 2
- payload is not json HOT 1
- 'file' attribute is not an object
- Flatten FormData fields HOT 1
- adapter extracting incorrect root HOT 1
- Conversion into FormData should properly handle nested objects.
- Server response HOT 1
- Base64 encoding HOT 1
- file attribute undefined
- version is not updated HOT 5
- Not everything should be FormData HOT 7
- JSON Parse error after upgrading to newer Ruby JSON gem HOT 2
- Add support for Ember 4 HOT 1
- consider having better handling of array values 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 ember-cli-form-data.