CSRF token can't verified rails Restangular

I'm trying to delete a user using Restangular. On the server receives a

Started DELETE "/users/9" for 127.0.0.1 at 2015-11-25 22:56:47 +0300
Processing by UsersController#destroy as HTML
  Parameters: {"id"=>"9"}
Can't verify CSRF token authenticity

However, in the PUT request and other error occurs, only DELETE

Started PUT "/users/9" for 127.0.0.1 at 2015-11-25 23:08:14 +0300
Processing by UsersController#update as */*
  Parameters: {"user"=>{"surname"=>"белозоров", "name"=>"helasdf", "patronymic"=>"asdfadf", "login"=>"login123123", "role_id"=>"1"}, "id"=>"9"}
  User Load (0.5ms)  SELECT  "users".* FROM "users" WHERE "users"."id" = $1  ORDER BY "users"."id" ASC LIMIT 1  [["id", 1]]

usersController

$scope.deleteUser = function(user){
        user.remove().then(
            function(){
                $scope.users = _.without($scope.users, user);
                alertify.success("Пользователь удален!");
            },
            function() {
                alertify.error("Не удалось удалить пользователя. Подробности неизвестны");
            }
        );
    };

Answers


if you are using rails 4.1 and above you have to use form submits for PUT and DELETE requests


Need Your Help

Must declare the scalar variable "@Sid" in gridview while getting single record

asp.net

while i'm trying to get single record from database table,based on login user details. i'm getting error,let me know where i'm doing wrong.