0👍
The code above is using Rails resources (routes.rb) without defining a default format and an Axios POST request that doesn’t specify a format.
When you submit the POST request check the rails server log and see how the controller is processing the request. I’d anticipate the above will generate the line: "Processing by CampaignsController#create as HTML".
Try either defining a default format in the routes file (https://guides.rubyonrails.org/routing.html#defining-defaults):
defaults format: :json do
resources :campaigns
end
or specifying a format for the POST request.
axios.post('/campaigns.json', ...)...
- [Vuejs]-How to fetch data from the DB using Vue axios in laravel?
- [Vuejs]-Position: absolute only working on the first item
Source:stackexchange.com