【发布时间】:2015-03-13 04:09:26
【问题描述】:
在 rails 4.2 我有一个控制器,我想用非资源路由填充类似
class TwilioController < ApplicationController
def add_to_queue
end
def another_action
end
end
然后我想像这样访问这些操作
http://appdomain/twilio/add-to-queue
和
http://appdomain.com/twilio/another-action
我意识到我可以在路由文件中这样做
get 'twilio/add-to-queue', to: 'twilio#add_to_queue'
get 'twilio/another-action', to: 'twilio#another_action'
但是有没有办法将所有这些组合在一起,所以我不必在每条路线的开头明确添加twilio。
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-4 routing rails-routing