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:
parent
b8d6dc3c84
commit
6c906bf591
3 changed files with 12 additions and 16 deletions
|
@ -303,6 +303,8 @@ module Rails
|
|||
end
|
||||
end
|
||||
|
||||
self.routes.default_scope = {:module => name}
|
||||
|
||||
self.namespaced = true
|
||||
end
|
||||
|
||||
|
|
|
@ -390,7 +390,6 @@ 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"
|
||||
|
@ -398,7 +397,6 @@ module RailtiesTest
|
|||
match "/polymorphic_path_without_namespace" => "foo#polymorphic_path_without_namespace"
|
||||
resources :posts
|
||||
end
|
||||
end
|
||||
RUBY
|
||||
|
||||
app_file "app/helpers/some_helper.rb", <<-RUBY
|
||||
|
@ -514,10 +512,8 @@ module RailtiesTest
|
|||
|
||||
@plugin.write "config/routes.rb", <<-RUBY
|
||||
Bukkits::Engine.routes.draw do
|
||||
scope(:module => :bukkits) do
|
||||
resources :posts
|
||||
end
|
||||
end
|
||||
RUBY
|
||||
|
||||
@plugin.write "app/controllers/bukkits/posts_controller.rb", <<-RUBY
|
||||
|
|
|
@ -56,13 +56,11 @@ 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
|
||||
end
|
||||
end
|
||||
RUBY
|
||||
|
||||
@plugin.write "app/controllers/blog/posts_controller.rb", <<-RUBY
|
||||
|
|
Loading…
Reference in a new issue