Skip to content
Browse files

Show routes defined under assets prefix

Closes #9625
  • Loading branch information...
1 parent c5b76b5 commit d54bc032c90517fc1e57db9fca75e3297acc86fb @tricknotes tricknotes committed with carlosantoniodasilva Dec 7, 2013
View
4 actionpack/CHANGELOG.md
@@ -1,3 +1,7 @@
+* `rake routes` shows routes defined under assets prefix.
+
+ *Ryunosuke SATO*
+
* Extend cross-site request forgery (CSRF) protection to GET requests with
JavaScript responses, protecting apps from cross-origin `<script>` tags.
View
2 actionpack/lib/action_dispatch/routing/inspector.rb
@@ -69,7 +69,7 @@ def action
end
def internal?
- controller.to_s =~ %r{\Arails/(info|mailers|welcome)} || path =~ %r{\A#{Rails.application.config.assets.prefix}}
+ controller.to_s =~ %r{\Arails/(info|mailers|welcome)} || path =~ %r{\A#{Rails.application.config.assets.prefix}\z}
end
def engine?
View
12 actionpack/test/dispatch/routing/inspector_test.rb
@@ -203,6 +203,18 @@ def test_rake_routes_dont_show_app_mounted_in_assets_prefix
assert_no_match(/\/sprockets/, output.first)
end
+ def test_rake_routes_shows_route_defined_in_under_assets_prefix
+ output = draw do
+ scope '/sprockets' do
+ get '/foo' => 'foo#bar'
+ end
+ end
+ assert_equal [
+ "Prefix Verb URI Pattern Controller#Action",
+ " foo GET /sprockets/foo(.:format) foo#bar"
+ ], output
+ end
+
def test_redirect
output = draw do
get "/foo" => redirect("/foo/bar"), :constraints => { :subdomain => "admin" }

0 comments on commit d54bc03

Please sign in to comment.
Something went wrong with that request. Please try again.