aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/route_set.rb
Commit message (Collapse)AuthorAgeFilesLines
* prepend the assets route instead of appending, closes #436José Valim2011-05-081-3/+6
|
* Use #remove_possible_method instead hereSebastian Martinez2011-05-041-2/+3
|
* raise an error if the old router draw method is used, along with a message ↵Josh Kalderimis2011-05-031-0/+5
| | | | advising them to either upgrade their routes or add rails_legacy_mapper to their Gemfile
* Explicitly define main_app proxyPiotr Sarnacki2011-04-251-2/+1
|
* stop being clever and just call methods on the Route objectAaron Patterson2011-03-081-1/+1
|
* Raise ArgumentError if route name is invalid [#6517 state:resolved]Andrew White2011-03-061-0/+2
|
* use newer class cache apiAaron Patterson2011-03-021-1/+1
|
* refactor Reference to a ClassCache object, fix lazy lookup in Middleware so ↵Aaron Patterson2011-03-011-2/+3
| | | | that anonymous classes are supported
* Fix assert_recognizes with block constraints [#5805 state:resolved]Andrew White2011-02-131-1/+3
|
* use raise to create exceptions and to set the backtraceAaron Patterson2011-01-121-1/+1
|
* The redirect routing method now allows for a hash of options which only ↵Josh Kalderimis2010-11-301-44/+18
| | | | changes the relevant parts of the url, or an object which responds to call can be supplied so common redirect rules can be easily reused. This commit includes a change where url generation from parts has been moved to AD::Http::URL as a class method.
* Speed up subdomain and domain calculus.José Valim2010-11-231-14/+6
|
* :subdomain, :domain and :tld_length options can now be used in url_for, ↵Josh Kalderimis2010-11-231-6/+32
| | | | | | allowing for easy manipulation of the host during link generation. Signed-off-by: José Valim <jose.valim@gmail.com>
* Properly reload routes defined in class definitionPiotr Sarnacki2010-09-301-0/+1
| | | | | | | | | | | | | | | | | 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
* Allow mounting engines at '/'Piotr Sarnacki2010-09-301-1/+1
| | | | | Without that commit script_name always become '/', which results in paths like //posts/1 instead of /posts/1
* Merge remote branch 'miloops/warnings'José Valim2010-09-291-1/+1
|\
| * Use redefine_method instead define_method, it may be already defined.Emilio Tagua2010-09-281-1/+1
| |
| * Move uri parser to AS as URI.parser method to reuse it in AP and ARes.Emilio Tagua2010-09-271-8/+2
| |
* | Move uri parser to AS as URI.parser method to reuse it in AP and ARes.Emilio Tagua2010-09-281-8/+2
| |
* | Fix tests on 1.9.2.José Valim2010-09-281-5/+0
| |
* | Properly initialize variables inside the initialize method.José Valim2010-09-271-3/+8
|/
* Define @_routes inside method, makes more sense and will be initialized when ↵Emilio Tagua2010-09-271-1/+1
| | | | | | called anywhere. Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Remove warning "URI.unescape is obsolete" from actionpack.Emilio Tagua2010-09-271-4/+2
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Merge remote branch 'miloops/warnings'José Valim2010-09-271-2/+12
|\ | | | | | | | | Conflicts: actionpack/lib/action_controller/metal/url_for.rb
| * Remove old method before redefining it.Emilio Tagua2010-09-271-0/+2
| |
| * Remove warning "URI.unescape is obsolete" from actionpack.Emilio Tagua2010-09-271-2/+10
| |
* | Hash#empty? is faster than Enumerable#any? when used on a Hash.thedarkone2010-09-271-1/+1
| |
* | No need to create a separate lambda for each call.thedarkone2010-09-271-15/+14
|/
* Refactor routing methods.Emilio Tagua2010-09-221-6/+1
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Add RouteSet#appendCarl Lerche2010-09-171-4/+12
| | | Allows specifying blocks to the routeset that will get appended after the RouteSet is drawn.
* Change app to main_app in mounted_helpersPiotr Sarnacki2010-09-081-1/+1
|
* Do not require passing :app to mounted helpers, it's actually useless and ↵Piotr Sarnacki2010-09-081-1/+1
| | | | not DRY
* Removed deprecated RouteSet API, still many tests failPiotr Sarnacki2010-09-051-9/+3
|
* Implemented RouteSet#default_scope, which allows to set the scope for the ↵Piotr Sarnacki2010-09-031-2/+6
| | | | entire routes object
* Move RoutesProxy to separate filePiotr Sarnacki2010-09-031-32/+0
|
* This was used only to clear warning in ActionMailer tests, it shouldn't be ↵Piotr Sarnacki2010-09-031-5/+0
| | | | done like that
* Refactor RoutesProxy to avoid using _with_routes in helpersPiotr Sarnacki2010-09-031-1/+1
|
* Refactor ActionMailer to not use hide_actionsPiotr Sarnacki2010-09-031-1/+6
|
* Fix generating urls with mounted helpers in view contextPiotr Sarnacki2010-09-031-1/+1
| | | | | | | | | | There were actually 2 problems with this one: * script_name was added to options as a string and then it was used in RouteSet#url_for with usage of <<, which was changing the original script_name * the second issue was with _with_routes method. It was called in RoutesProxy to modify _routes in view_context, but url_helpers in views is just delegating it to controller, so another _with_routes call is needed there
* For view_context we need to initialize RoutesProxy in context of controller, ↵Piotr Sarnacki2010-09-031-2/+4
| | | | not view, quick fix, I need to dig into it later
* We don't need delegating polymorphic_url and polymorphic_path anymorePiotr Sarnacki2010-09-031-10/+6
|
* Add mounted_helpers to routesPiotr Sarnacki2010-09-031-0/+59
| | | | | | | | | | | | | | | | mounted_helpers are a bit similar to url_helpers. They're automatically included in controllers for Rails.application and each of mounted Engines. Mounted helper allows to call url_for and named helpers for given application. Given Blog::Engine mounted as blog_engine, there are 2 helpers defined: app and blog_engine. You can call routes for app and engine using those helpers: app.root_url app.url_for(:controller => "foo") blog_engine.posts_path blog_engine.url_for(@post)
* Routes refactoring:Piotr Sarnacki2010-09-031-1/+1
| | | | | | | * added more tests for prefix generation * fixed bug with generating host for both prefix and url * refactored url_for method * organized tests for prefix generation
* Extended url_for to handle specifying which router should be used.Piotr Sarnacki2010-09-031-12/+12
| | | | | | | A few examples: url_for Blog::Engine, :posts_path url_for Blog::Engine, @post url_for Blog::Engine, :action => "main", :controller => "index"
* Get rid of :skip_prefix options in routesPiotr Sarnacki2010-09-031-6/+3
|
* New way of generating urls for Application from Engine.Piotr Sarnacki2010-09-031-2/+2
| | | | | | | | | It's based specifying application's script_name with: Rails.application.default_url_options = {:script_name => "/foo"} default_url_options method is delegated to routes. If router used to generate url differs from the router passed via env it always overwrites :script_name with this value.
* Use env['action_dispatch.routes'] to determine if we should generate prefix ↵Piotr Sarnacki2010-09-031-6/+14
| | | | | | | | | | or not. This technique is here to allow using routes from Engine in Application and vice versa. When using Engine routes inside Application it should generate prefix based on mount point. When using Engine routes inside Engine it should use env['SCRIPT_NAME']. In any other case it should generate prefix as env should not be even available.
* Revert "Setup explicit requires for files with exceptions. Removed them from ↵José Valim2010-09-021-1/+0
| | | | | | | | autoloading." Booting a new Rails application does not work after this commit [#5359 state:open] This reverts commit 38a421b34d0b414564e919f67d339fac067a56e6.
* Setup explicit requires for files with exceptions. Removed them from ↵Łukasz Strzałkowski2010-09-021-0/+1
| | | | | | autoloading. Signed-off-by: José Valim <jose.valim@gmail.com>
* Support routing constraints in functional testsAndrew White2010-08-201-2/+2
| | | | | | | | | | Extend assert_recognizes and assert_generates to support passing full urls as the path argument. This allows testing of routing constraints such as subdomain and host within functional tests. [#5005 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>