1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionpack/lib/action_dispatch/routing
Piotr Sarnacki ec5d846ac6 Properly reload routes defined in class definition
Sometimes it's easier to define routes inside Engine or
Application class definition (e.g. one file applications). The
problem with such case is that if there is a plugin that
has config/routes.rb file, it will trigger routes reload on application.
Since routes definition for application is not in config/routes.rb
file routes_reloader will fail to reload application's routes
properly. With this commit you can pass routes definition as a block
to routes method, which will allow to properly reload it:

class MyApp::Application < Rails::Application
  routes do
    resources :users
  end
end
2010-09-30 09:47:05 +02:00
..
mapper.rb Use .find here as it is simpler and faster. 2010-09-30 07:25:06 +02:00
polymorphic_routes.rb Convert unless/else into if/else. 2010-09-27 17:46:00 +02:00
route.rb Refactor routing methods. 2010-09-22 18:08:03 -03:00
route_set.rb Properly reload routes defined in class definition 2010-09-30 09:47:05 +02:00
routes_proxy.rb Move RoutesProxy to separate file 2010-09-03 22:59:13 +02:00
url_for.rb Avoid (@_var ||= nil) pattern by using initialize methods and ensuring everyone calls super as expected. 2010-09-29 11:18:31 +02:00