路线.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
我遇到路由错误,无法理解错误可能出在哪里