if i use
namespace :helpcenter do
get "hh/logout"
get 'hh/login'
end
it will match the url helpcenter/hh/logout
my question is ho开发者_如何学Gow to let these method mapping to the url /hh/logout didn't contains the module name
You can use a scope to achieve this:
scope :module => 'helpcenter' do
resources :articles
end
This will generate a mapping for /articles
, /articles/new
etc and not helpcenter/articles
. It will however still route to the articles controller in the helpcenter namespace. e.g.: app/controllers/helpcenter/articles_controller.rb
Hope that helps.
精彩评论