From 73bbf548687a3502cc87aaea4484943e65dce053 Mon Sep 17 00:00:00 2001 From: Piotr Sarnacki Date: Mon, 22 Jul 2013 17:19:07 +0200 Subject: Revert "Match Dev/Prod parity for Index Page" Showing welcome page in production can expose information, which should not be visible on production if people don't override the default root route. This reverts commit b0caea29c2da9f4c8bb958019813482da297067d. --- railties/lib/rails/application/finisher.rb | 4 +--- railties/lib/rails/templates/rails/welcome/index.html.erb | 2 +- railties/test/application/routing_test.rb | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) (limited to 'railties') diff --git a/railties/lib/rails/application/finisher.rb b/railties/lib/rails/application/finisher.rb index 1e4c6ca921..7a1bb1e25c 100644 --- a/railties/lib/rails/application/finisher.rb +++ b/railties/lib/rails/application/finisher.rb @@ -25,11 +25,9 @@ module Rails get '/rails/info/properties' => "rails/info#properties" get '/rails/info/routes' => "rails/info#routes" get '/rails/info' => "rails/info#index" + get '/' => "rails/welcome#index" end end - app.routes.append do - get '/' => "rails/welcome#index" - end end initializer :build_middleware_stack do diff --git a/railties/lib/rails/templates/rails/welcome/index.html.erb b/railties/lib/rails/templates/rails/welcome/index.html.erb index dd35835c6f..eb620caa00 100644 --- a/railties/lib/rails/templates/rails/welcome/index.html.erb +++ b/railties/lib/rails/templates/rails/welcome/index.html.erb @@ -227,7 +227,7 @@
  • Set up a root route to replace this page

    -

    You're seeing this page because you haven't set a root route yet.

    +

    You're seeing this page because you're running in development mode and you haven't set a root route yet.

    Routes are set up in config/routes.rb.

  • diff --git a/railties/test/application/routing_test.rb b/railties/test/application/routing_test.rb index e1679315f8..8576a2b738 100644 --- a/railties/test/application/routing_test.rb +++ b/railties/test/application/routing_test.rb @@ -60,7 +60,7 @@ module ApplicationTests test "rails/welcome in production" do app("production") get "/" - assert_equal 200, last_response.status + assert_equal 404, last_response.status end test "rails/info/routes in production" do -- cgit v1.2.3