【问题标题】:Ignoring the devise routes does not work忽略设计路线不起作用
【发布时间】:2018-05-16 14:33:19
【问题描述】:

我正在尝试为应用程序的登录/注册自定义过程编写 API,但想通过我的应用程序使用该设计的功能。问题是没有在config/routes.rb 中定义devise_for :usersdevise_scope :user 没有创建设计的地图,所以我不能使用sign_in @user 等。

问题:

如何在不启用路由的情况下使用设备的功能?

【问题讨论】:

    标签: ruby-on-rails api devise


    【解决方案1】:

    我想通了

    # 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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-08-18
      • 2016-01-25
      • 1970-01-01
      • 1970-01-01
      • 2013-03-15
      • 2019-11-28
      • 2013-05-16
      相关资源
      最近更新 更多