mardi 13 septembre 2016

ember 2.8 rails 4.2.4: Rails not receiving payload that ember is sending

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:

enter image description here

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