weixin_33712987 2017-03-11 16:04 采纳率: 0%
浏览 7

用ajax POST设计

I can't access current_user in my api controller when sending a POST request. It says it is null.

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

What am I doing wrong? I read a couple of posts on SO and the solutions do not work.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 对于相关问题的求解与代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料
    • ¥15 使用R语言marginaleffects包进行边际效应图绘制