I mounted the Forem::Engine in my app
MyApp::Application.routes.draw do
scope “/:locale” do
…
resources :sites, :only => [:none] do
get ‘home’, :on => :collection
get ‘events’, :on => :collection
end
…
mount Forem::Engine, :at => “/forums”, :as => :forums,
constraints: lambda { |r| r.subdomain.present? && r.subdomain !=
‘www’ } , :defaults => { :locale => I18n.locale }
…
end
when I display the home page of the subdomain, http://bingo.lvh.me:3000/
I don’t have any problem with the navbar links in the header
in which I have :
= link_to t(:home), home_sites_path(:locale => I18n.locale)
= link_to t(:forums), forums_path(:locale => I18n.locale)
Upon clicking on ‘forums’ item ( generated url: bingo.lvh.me:3000/
en/forums ) , I am redirected correctly to the engine
Forem::forums#index, the rendering raises an error with the home
link …
undefined method `home_sites_path’ for #<#Class:0x007fdd936ce5f8:
0x007fdd96db7e70>
it seems that my app routing is lost
despite the fact that I get the route in my routes.rb, but maybe
‘forums_path’ is not the right
what could be wrong ? thanks for feedback