【发布时间】:2018-05-27 20:48:51
【问题描述】:
我的 jsonwebtokenauthentication.rb 位于 (app/lib.jsonwebtokenauthentication.rb):
class JsonWebTokenAuthentication
def some_method
#logic of the method
end
end
我正在尝试访问我的 registrations_controller.rb(app/controllers/api/v1/registrations_controller.rb) 中的上述 JsonWebTokenAuthentication 方法
class Api::V1::RegistrationsController < Api::V1::BaseController
def create
auth_token = JsonWebTokenAuthentication.some_method({user_id: user.id})
end
end
end
我们如何使用在rails项目的lib文件夹中指定的类方法。
【问题讨论】:
-
请仔细检查您的问题,我不清楚。
app/lib.jsonwebtokenauthentication.rb是什么?
标签: ruby-on-rails