Skip to content

Commit

Permalink
Show routes defined under assets prefix
Browse files Browse the repository at this point in the history
Closes #9625

Conflicts:
	actionpack/CHANGELOG.md
	actionpack/lib/action_dispatch/routing/inspector.rb
  • Loading branch information
tricknotes authored and carlosantoniodasilva committed Dec 19, 2013
1 parent 2fb582f commit 0585ba0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
4 changes: 4 additions & 0 deletions actionpack/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* `rake routes` shows routes defined under assets prefix.

*Ryunosuke SATO*

* Label tags generated by collection helpers only inherit the `:index` and
`:namespace` from the input, because only these attributes modifies the
`for` attribute of the label. Also, the input attributes don't have
Expand Down
2 changes: 1 addition & 1 deletion actionpack/lib/action_dispatch/routing/inspector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def action
end

def internal?
controller.to_s =~ %r{\Arails/(info|welcome)} || path =~ %r{\A#{Rails.application.config.assets.prefix}}
controller.to_s =~ %r{\Arails/(info|welcome)} || path =~ %r{\A#{Rails.application.config.assets.prefix}\z}
end

def engine?
Expand Down
12 changes: 12 additions & 0 deletions actionpack/test/dispatch/routing/inspector_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down

0 comments on commit 0585ba0

Please sign in to comment.