gpt4 book ai didi

jquery - 通过 jQuery Mobile 使用 Devise 登录

转载 作者:行者123 更新时间:2023-12-03 23:00:59 25 4
gpt4 key购买 nike

我们有一个使用 Devise 进行身份验证(电子邮件、密码)的工作应用程序。

为了添加移动界面,我们使用 jQuery mobile — 一切正常,只是通过 Devise 登录无法正常工作。

点击“登录”后,Rails 正确处理了请求,但我们得到的只是 MissingTemplate (devise/sessions/create) 错误。

<小时/>

当前设置:

config.http_authenticatable_on_hxr = false

config.navigational_formats = [:"*/*", "*/*", :html, :mobile]
<小时/>

我们的灵感来自 Railscast #199(因此 :mobile):http://railscasts.com/episodes/199-mobile-devices

最佳答案

尝试本指南中的最后一步 How To: Make Devise work with other formats like mobile, iphone and ipad (Rails specific) .

记住使用 :to_mobile 而不是 :to_ios,所以:

ActionController::Responder.class_eval do
alias :to_mobile :to_html
end

在 config/initializers 中的新初始化程序文件中

关于jquery - 通过 jQuery Mobile 使用 Devise 登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5794926/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com