Simple Rails api back end, ember front end app. I'm trying to create a new record and Ember seems to be formatting the POST
request correctly:
It's hitting my controller in the create
action but there are no params
getting through. It's simply:
{"format"=>"json", "controller"=>"api/v1/vehicles", "action"=>"create"}
request.headers
does not show any of the vehicle information I'm trying to create.
I've whitelisted everything needed in the controller:
def vehicle_params
params.require(:vehicle).permit(:plate_num, :vehicle_type, :state)
end
I have no idea if relevant but I've set up CORS to accept everything:
config.middleware.insert_before 0, "Rack::Cors" do
allow do
origins '*'
resource '*', :headers => :any, :methods => :any
end
end
What else do I need to check?
Aucun commentaire:
Enregistrer un commentaire