aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2012-12-18 16:29:00 +0100
committerDavid Heinemeier Hansson <david@loudthinking.com>2012-12-18 16:29:00 +0100
commit09aeee7247682178868241d446051696570e6e12 (patch)
tree51f4af1494145068345806ab21d2c38578bf6947 /railties
parentf6bbc3f582bfc16da3acc152c702b04102fcab81 (diff)
parentf6d0eda918756bf56e2c05afcaaabda723487017 (diff)
downloadrails-09aeee7247682178868241d446051696570e6e12.tar.gz
rails-09aeee7247682178868241d446051696570e6e12.tar.bz2
rails-09aeee7247682178868241d446051696570e6e12.zip
Merge
Diffstat (limited to 'railties')
-rw-r--r--railties/CHANGELOG.md6
-rw-r--r--railties/lib/rails/info_controller.rb4
-rw-r--r--railties/lib/rails/templates/rails/info/routes.html.erb5
-rw-r--r--railties/test/rails_info_controller_test.rb2
4 files changed, 13 insertions, 4 deletions
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md
index 239fc10719..a32f33140b 100644
--- a/railties/CHANGELOG.md
+++ b/railties/CHANGELOG.md
@@ -1,8 +1,14 @@
## Rails 4.0.0 (unreleased) ##
+<<<<<<< HEAD
* Add app/models/concerns and app/controllers/concerns to the default directory structure and load path *DHH*
See http://37signals.com/svn/posts/3372-put-chubby-models-on-a-diet-with-concerns for usage instructions.
+=======
+* The `rails/info/routes` now correctly formats routing output as an html table.
+
+ *Richard Schneeman*
+>>>>>>> f6d0eda918756bf56e2c05afcaaabda723487017
* The `public/index.html` is no longer generated for new projects.
Page is replaced by internal `welcome_controller` inside of railties.
diff --git a/railties/lib/rails/info_controller.rb b/railties/lib/rails/info_controller.rb
index e296637f39..e650f58d20 100644
--- a/railties/lib/rails/info_controller.rb
+++ b/railties/lib/rails/info_controller.rb
@@ -2,6 +2,7 @@ require 'action_dispatch/routing/inspector'
class Rails::InfoController < ActionController::Base # :nodoc:
self.view_paths = File.expand_path('../templates', __FILE__)
+ prepend_view_path ActionDispatch::DebugExceptions::RESCUES_TEMPLATE_PATH
layout 'application'
before_filter :require_local!
@@ -15,8 +16,7 @@ class Rails::InfoController < ActionController::Base # :nodoc:
end
def routes
- inspector = ActionDispatch::Routing::RoutesInspector.new
- @info = inspector.format(_routes.routes).join("\n")
+ @routes = ActionDispatch::Routing::RoutesInspector.new.collect_routes(_routes.routes)
end
protected
diff --git a/railties/lib/rails/templates/rails/info/routes.html.erb b/railties/lib/rails/templates/rails/info/routes.html.erb
index 890f6f5b03..1ea387c63f 100644
--- a/railties/lib/rails/templates/rails/info/routes.html.erb
+++ b/railties/lib/rails/templates/rails/info/routes.html.erb
@@ -6,4 +6,7 @@
Routes match in priority from top to bottom
</p>
-<p><pre><%= @info %></pre></p> \ No newline at end of file
+<%# actionpack/lib/action_dispatch/middleware/templates %>
+<%= render layout: "routes/route_wrapper" do %>
+ <%= render partial: "routes/route", collection: @routes %>
+<% end %>
diff --git a/railties/test/rails_info_controller_test.rb b/railties/test/rails_info_controller_test.rb
index 08fcddd4bf..a9b237d0a5 100644
--- a/railties/test/rails_info_controller_test.rb
+++ b/railties/test/rails_info_controller_test.rb
@@ -50,7 +50,7 @@ class InfoControllerTest < ActionController::TestCase
test "info controller renders with routes" do
get :routes
- assert_select 'pre'
+ assert_response :success
end
end