I have a pretty simple model called Deal with name and description where name is non-nullable.
When I post the following to /api/deals
{"name":"oaeu"}
I get the error
SQLite3::ConstraintException: deals.name may not be NULL: INSERT INTO "deals" ("created_at", "updated_at") VALUES (?, ?)
My Model
enter code here
My Controller
class DealsController < InheritedResources::Base
protected
def permitted_params
params.require(:deal).permit(:name)
end
end
My Model
class Deal < ActiveRecord::Base
end
I can't figure out what is going on!!!
My Gemfile includes:
gem 'rails', '4.0.2'
and
gem 'inherited_resources'
Any ideas?