1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Use default_scope in isolated Engines to not force user to scope his routes

This commit is contained in:
Piotr Sarnacki 2010-09-01 19:31:29 +02:00
parent b8d6dc3c84
commit 6c906bf591
3 changed files with 12 additions and 16 deletions

View file

@ -303,6 +303,8 @@ module Rails
end
end
self.routes.default_scope = {:module => name}
self.namespaced = true
end

View file

@ -390,14 +390,12 @@ module RailtiesTest
@plugin.write "config/routes.rb", <<-RUBY
Bukkits::Engine.routes.draw do
scope(:module => :bukkits) do
match "/foo" => "foo#index", :as => "foo"
match "/foo/show" => "foo#show"
match "/from_app" => "foo#from_app"
match "/routes_helpers_in_view" => "foo#routes_helpers_in_view"
match "/polymorphic_path_without_namespace" => "foo#polymorphic_path_without_namespace"
resources :posts
end
match "/foo" => "foo#index", :as => "foo"
match "/foo/show" => "foo#show"
match "/from_app" => "foo#from_app"
match "/routes_helpers_in_view" => "foo#routes_helpers_in_view"
match "/polymorphic_path_without_namespace" => "foo#polymorphic_path_without_namespace"
resources :posts
end
RUBY
@ -514,9 +512,7 @@ module RailtiesTest
@plugin.write "config/routes.rb", <<-RUBY
Bukkits::Engine.routes.draw do
scope(:module => :bukkits) do
resources :posts
end
resources :posts
end
RUBY

View file

@ -56,11 +56,9 @@ module ApplicationTests
@plugin.write "config/routes.rb", <<-RUBY
Blog::Engine.routes.draw do
scope(:module => :blog) do
resources :posts do
get :generate_application_route
get :application_route_in_view
end
resources :posts do
get :generate_application_route
get :application_route_in_view
end
end
RUBY