【发布时间】:2018-05-16 14:33:19
【问题描述】:
我正在尝试为应用程序的登录/注册自定义过程编写 API,但想通过我的应用程序使用该设计的功能。问题是没有在config/routes.rb 中定义devise_for :users 或devise_scope :user 没有创建设计的地图,所以我不能使用sign_in @user 等。
问题:
如何在不启用路由的情况下使用设备的功能?
【问题讨论】:
标签: ruby-on-rails api devise
我正在尝试为应用程序的登录/注册自定义过程编写 API,但想通过我的应用程序使用该设计的功能。问题是没有在config/routes.rb 中定义devise_for :users 或devise_scope :user 没有创建设计的地图,所以我不能使用sign_in @user 等。
如何在不启用路由的情况下使用设备的功能?
【问题讨论】:
标签: ruby-on-rails api devise
我想通了
# config/routes.rb
Rails.application.routes.draw do
# root controller#action
root 'home#index'
# define the devise's user and
# disable direct access to devise's routes
devise_for :users, skip: :all
end
【讨论】: