Ruby on rails 使用ajax POST设计
发送Ruby on rails 使用ajax POST设计,ruby-on-rails,ajax,devise,Ruby On Rails,Ajax,Devise,发送POST请求时,我无法访问api控制器中的当前用户。 它说它是空的 class ApiController < ApplicationController before_action :set_default_format skip_before_action :verify_authenticity_token private def set_default_format request.format = :json
POST
请求时,我无法访问api控制器中的当前用户。
它说它是空的
class ApiController < ApplicationController
before_action :set_default_format
skip_before_action :verify_authenticity_token
private
def set_default_format
request.format = :json
end
end
class Api::V1::PhotosController < ApiController
...
end
class ApiController
我做错了什么?我在SO上读了几篇帖子,但解决方案不起作用。快速问题——在操作:验证用户之前您是否忘记了代码>?@31piy不,它在那里,在Api::V1::PhotosController中,很抱歉我没有把它包括在这里。