Try
services.factory('Room', ['$resource',
function($resource)
{
return $resource('/room/:room_id', {}, {
enter: {method: 'PUT', params:{room_id:'@room_id'}}
});
}
]);
Edit:
Your parameters are passed as an object. Therefore, '@room_id'
means that the value of the room_id
property of the object passed should be extracted.
Note that the names must not match. In your controller, you could as well say
Room.enter({id: '5'}...
and get the value of the parameter in your service as
..., params:{room_id:'@id'}