複数のエンジンを使用してRails 4 rc1でマルチテナンシーアプリを構築しています。しかし、エンジン間のルーティングに問題があります。これが私のアプリケーション構造です。
hostapp/
admin/
frontend/
store_admin/
store_frontend/
そして私のroutes.rb
:
Hostapp::Application.routes.draw do
constraints(Subdomain) do
mount StoreFrontend::Engine => '/', as: 'store_frontend'
mount StoreAdmin::Engine => '/admin', as: 'store_admin'
end
mount Frontend::Engine => '/', as: 'frontend'
mount Admin::Engine => '/admin', as: 'admin'
end
そして最後はfrontend
エンジンroutes.rb
Frontend::Engine.routes.draw do
get "/auth/:provider/callback", to: "authentications#callback", as: 'facebook_auth'
get "/auth/failure", to: "authentications#failure", as: 'facebook_auth_failure'
end
例:リンクの下にしようとしています
<%= link_to "Facebook", frontend.facebook_auth_url(provider: "facebook", subdomain: nil), class: "social-facebook" %>
store_admin
エンジンで。それは私を示していますhttp://127.0.0.1.xip.io:3000/admin/auth/facebook/callback
。しかし、それは正しいリンクではありません。正しいリンクは次のとおりです。http://127.0.0.1.xip.io:3000/auth/facebook/callback
わかりません。みんな助けてください。情報が必要な場合はお知らせください。そしてアドバイスありがとうございます:)
更新: ここに問題を作成しました: https://github.com/rails/rails/issues/10904