0

路线.rb

  post 'pets/pets_you_liked' => 'pets#pets_you_liked'

pets.js.coffee

  $.ajax
    type: 'POST',
    data: {pet_id: pet_id},
    url: "/pets/pets_you_liked"

耙路线

rake routes | grep pets_you_like
pets_pets_you_liked POST    pets/pets_you_liked(.:format)    pets#pets_you_liked

宠物控制器.rb

def pets_you_liked
 raise 'checking'
end

我遇到路由错误,无法理解错误可能出在哪里

4

1 回答 1

0

尝试如下,

post '/pets/pets_you_liked' => 'pets#pets_you_liked
于 2013-03-25T06:43:28.947 回答