in Rails4 when using Angular ngResource with update method 'PATCH', I get a server error:
ActionController::ParameterMissing (param not found: page):
app/controllers/json_api/pages_controller.rb:39:in `filter_page_params'
app/controllers/json_api/pages_controller.rb:17:in `update'
window.app.factory 'Page', ($resource) ->
...
ReStFull: ( ->
return $resource('/json/pages/:id', {id: '@id'}, {update: {method: 'PATCH'}})
)
Only PUT works!
My Rails4 controller action looks like this:
def update
if @page.update_attributes(filter_page_params)
render json: @page
else
render nothing: true, status: 400
end
end
the strong parameter private function:
def filter_page_params
params.require(:page).permit(:parent_id, :name, :grid_layout_id)
end
There's a preload hook on update as well having @page already loaded from DB
Does anybody know what causes angular to break the request?
I apreciate any help. kind regards, Alex