0
我在我的rails 5项目中创建了名称空间API。我在我的配置/ routes.rb中在Rails应用程序中的名称空间API中定义自定义路由
Rails.application.routes.draw do
post 'api_user_token' => 'api_user_token#create'
namespace :api do
namespace :v1 do
resources :events
end
end
end
活动控制器
module Api::V1
class EventsController < ApiController
#Code here
end
end
API控制器的以下
module Api::V1
class ApiController < ApplicationController
before_action :authenticate_api_user
respond_to :json
def register
end
end
end
我想'/ API/V1 /注册'路线去我的api控制器中定义的注册方法。我如何在这种情况下定义路线?
感谢