[Rails] routing issue with mounted engine - Rails 3.2.8
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
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home