Gem Devise 登录和注册怎么写对应 json 的请求????

chancedoor · October 20, 2013 · Last by ChanceDoor replied at October 21, 2013 · 4324 hits

查了好久也查不出个结果 主要是 Session 的 create 这里要怎么写啊~~~跪求 T T

登录已经可以啦

参考:http://stackoverflow.com/questions/4522069/rails-3-devise-how-to-get-devise-to-respond-with-json

是不是发现取不到 current_user 啊 config/appliacation.rb

config.to_prepare do
  DeviseController.respond_to :html,:json
end

#1 楼 @messiahxu 额 没 不明不白反正照着上面那个复制就可以了 - -

3 Floor has deleted

#2 楼 @ChanceDoor 因为 devise 现在默认不会相应 json,所以必须设置一下。

#4 楼 @messiahxu 哦 你是这个意思 我直接在 controller 里加了 respond_to :html, :json

You need to Sign in before reply, if you don't have an account, please Sign up first.