Answer the question
In order to leave comments, you need to log in
Failed to load resource: the server responded with a status of 400 (Bad Request)?
When I try to create an entry, I get the following error:
Started POST "/spr_type_events" for 127.0.0.1 at 2018-07-02 14:16:20 +0500
Processing by SprTypeEventsController#create as JSON
Parameters: {"spr_type_event"=>{}}
Completed 400 Bad Request in 1ms
ActionController::ParameterMissing (param is missing or the value is empty: spr_type_event):
app/controllers/spr_type_events_controller.rb:43:in `spr_type_events_params'
app/controllers/spr_type_events_controller.rb:15:in `create'
Answer the question
In order to leave comments, you need to log in
It's written in the log:
Parameters: {"spr_type_event"=>{}}That is, the form attributes required to create a SprTypeEvent are missing.
How can you get rid of it?Submit the required attributes.
params.require(:spr_type_event).permit!when trying to extract attributes from :spr_type_event there was a bummer. :-)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question