Closed slammyde7113 closed 7 years ago
can you post the ajax/curl request of posting to profiles?
#!/bin/bash
curl --include --request POST http://localhost:4741/profiles \
--header "Content-Type: application/json" \
--data '{
"credentials": {
"email": "testA",
"password": "test",
"password_confirmation": "test"
},
"menu_item": {
"price": "9.99",
"name": "Pizza",
"description": "Saucy goodness",
"location": "200 Blue St, Cat City"
},
"coupon_menu": {
"price": "9.99",
"name": "Pizza",
"description": "Saucy goodness",
"location": "200 Blue St, Cat City"
}
}'
actually, wouldn't be easier to just make another column in menu_item for coupon price? then I wouldnt have to make a new table
I'm gonna do that instead
I added a new table table to my database to hold coupon values but I'm having trouble connecting this new table to my Profiles table. I thought I did everything correctly (creating references to the appropriate tables, changed the permitted values on Profile.create, and updated my schema), but I keep getting this error:
But I'm passing all the right paramters to the create function.
Here are the related files: Profile Model
Profile Controller (changed to applicationController so I could post requests w/o token)
Schema