Add ActiveRecord::Base.include_root_in_json = false
in an initializer (or config/environment.rb)
Model should use attr_accessible in order to filter the parameter correctly In the example we use the model Task which only accessible attribute : name
Work as usual (cf tests)
It should use params
to create a new model, it should NOT use params[:model_name]
(default when using scaffolding) (cf tests)
We change params[:task]
to params
in the controller create method