0
我的路線:如何link_to子域外的路由?
class ActionDispatch::Routing::Mapper
def draw routes_name
instance_eval(File.read(Rails.root.join('config', 'routes', "#{routes_name}.rb")))
end
routes_a.rb
root :to => 'home#index'
controller :home do
post 'terms'
routes_b.rb
root :to => 'business/dashboards#show'
如果我目前在一個子域,community.website.com
,我創建link_to是這樣的:
= link_to 'Here', terms_path
它返回爲community.website.com/terms
而不是。如何返回?
啊好主意! – Trip