Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Further refactor build_conditions in route set | Carlos Antonio da Silva | 2012-08-10 | 1 | -5/+3 |
| | | | | | Return the conditions from the keep_if call, and ignore the value argument since it's not being used. | ||||
* | Fix handling SCRIPT_NAME from within mounted engine's | Piotr Sarnacki | 2012-08-11 | 1 | -5/+12 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you mount your application at a path, for example /myapp, server should set SCRIPT_NAME to /myapp. With such information, rails application knows that it's mounted at /myapp path and it should generate routes relative to that path. Before this patch, rails handled SCRIPT_NAME correctly only for regular apps, but it failed to do it for mounted engines. The solution was to hardcode default_url_options[:script_name], which is not the best answer - it will work only when application is mounted at a fixed path. This patch fixes the situation by respecting original value of SCRIPT_NAME when generating application's routes from engine and the other way round - when you generate engine's routes from application. This is done by using one of 2 pieces of information in env - current SCRIPT_NAME or SCRIPT_NAME for a corresponding router. This is because we have 2 cases to handle: - generating engine's route from application: in this situation SCRIPT_NAME is basically SCRIPT_NAME set by the server and it indicates the place where application is mounted, so we can just pass it as :original_script_name in url_options. :original_script_name is used because if we use :script_name, router will ignore generating prefix for engine - generating application's route from engine: in this situation we already lost information about the SCRIPT_NAME that server used. For example if application is mounted at /myapp and engine is mounted at /blog, at this point SCRIPT_NAME is equal /myapp/blog. Because of that we need to keep reference to /myapp SCRIPT_NAME by binding it to the current router. Later on we can extract it and use when generating url Please note that starting from now you *should not* use default_url_options[:script_name] explicitly if your server already passes correct SCRIPT_NAME to rack env. (closes #6933) | ||||
* | RouteSet: refactor internals | Bogdan Gusiev | 2012-08-10 | 1 | -10/+7 |
| | | | | | No need to build valid_conditions array. We can get all the data in place. | ||||
* | RouteSet: cleanup some unneeded compexity | Bogdan Gusiev | 2012-08-04 | 1 | -16/+7 |
| | |||||
* | Renamed _path_segments to _recall | Bogdan Gusiev | 2012-08-04 | 1 | -2/+2 |
| | |||||
* | Simplify logical statement | Bogdan Gusiev | 2012-08-04 | 1 | -4/+2 |
| | |||||
* | load active_support/core_ext/object/blank in active_support/rails | Xavier Noria | 2012-08-02 | 1 | -1/+0 |
| | |||||
* | Fix class_eval without __FILE__ and __LINE__. | kennyj | 2012-07-18 | 1 | -1/+1 |
| | |||||
* | Revert "Allow loading external route files from the router" | José Valim | 2012-06-29 | 1 | -2/+0 |
| | | | | | | | | | | | | | | This reverts commit 6acebb38bc0637bc05c19d87f8767f16ce79189b. Usage of this feature did not reveal any improvement in existing apps. Conflicts: actionpack/lib/action_dispatch/routing/mapper.rb guides/source/routing.textile railties/lib/rails/engine.rb railties/lib/rails/paths.rb railties/test/paths_test.rb | ||||
* | Simplify logic to initialize valid conditions in RouteSet | Carlos Antonio da Silva | 2012-05-31 | 1 | -7/+3 |
| | | | | | | Remove :to_sym call from public_instance_methods iteration, as such methods in Ruby 1.9 already return symbols. Initialize valid conditions with controller/action instead of setting them afterwards. | ||||
* | Merge pull request #2549 from trek/RoutingErrorForMissingControllers | Aaron Patterson | 2012-05-21 | 1 | -3/+7 |
|\ | | | | | When a route references a missing controller, raise ActionController::RoutingError with clearer message | ||||
| * | When a route references a missing controller, raise ↵ | Trek Glowacki | 2011-08-16 | 1 | -3/+7 |
| | | | | | | | | ActionController::RoutingError with a clearer message | ||||
* | | Return 400 Bad Request for URL paths with invalid encoding. | Andrew White | 2012-05-20 | 1 | -0/+9 |
| | | | | | | | | | | | | | | | | | | Passing path parameters with invalid encoding is likely to trigger errors further on like `ArgumentError (invalid byte sequence in UTF-8)`. This will result in a 500 error whereas the better error to return is a 400 error which allows exception notification libraries to filter it out if they wish. Closes #4450 | ||||
* | | Don't ignore nil positional arguments for url helpers - fixes #6196. | Andrew White | 2012-05-10 | 1 | -1/+1 |
| | | |||||
* | | Refactor Generator class to not rely on in-place editing the controller | Andrew White | 2012-05-09 | 1 | -5/+10 |
| | | |||||
* | | Fix bug when url_for changes controller. | Nikita Beloglazov | 2012-05-09 | 1 | -2/+2 |
| | | |||||
* | | Fix that optimized named routes should also work as singleton methods on the ↵ | Jeremy Kemper | 2012-05-06 | 1 | -1/+2 |
| | | | | | | | | url_helpers module | ||||
* | | RouteSet: optimize routes generation when globbing is used | Bogdan Gusiev | 2012-05-03 | 1 | -2/+5 |
| | | |||||
* | | RouteSet: remove some code dups | Bogdan Gusiev | 2012-05-02 | 1 | -19/+10 |
| | | |||||
* | | ActionPack routes: remove some useless code. | Bogdan Gusiev | 2012-05-02 | 1 | -26/+4 |
| | | |||||
* | | Allow loading external route files from the router | Jose and Yehuda | 2012-04-25 | 1 | -0/+2 |
| | | | | | | | | | | | | | | | | | | This feature enables the ability to load an external routes file from the router via: draw :filename External routes files go in +config/routes+. This feature works in both engines and applications. | ||||
* | | Refactor hash creation in routeset | Carlos Antonio da Silva | 2012-04-24 | 1 | -3/+4 |
| | | |||||
* | | RouteSet: decomplecting a way to handle positional args | Bogdan Gusiev | 2012-04-24 | 1 | -26/+20 |
| | | |||||
* | | RouteSet: simplify routes helpers generation code | Bogdan Gusiev | 2012-04-24 | 1 | -13/+21 |
| | | |||||
* | | documents the contract for the argument of AD::Routing::RouteSet#url_for | Xavier Noria | 2012-04-05 | 1 | -0/+1 |
| | | |||||
* | | Fix url_for when options is nil | Rafael Mendonça França | 2012-04-05 | 1 | -1/+1 |
| | | | | | | | | | | RouteSet#url_for was modifying the options hash that belong to the caller | ||||
* | | don't pass unnecessary argument | Sergey Nartimov | 2012-03-02 | 1 | -2/+2 |
| | | |||||
* | | Optimize url helpers. | Sergey Nartimov + José Valim | 2012-03-02 | 1 | -9/+8 |
| | | |||||
* | | Optimize path helpers. | José Valim | 2012-03-02 | 1 | -11/+54 |
| | | |||||
* | | Fix the assert_recognizes test method so that it works when there are | Matt Fawcett | 2012-02-24 | 1 | -0/+2 |
| | | | | | | | | constraints on the querystring. Issue #2781 | ||||
* | | Avoid inspecting the whole route set, closes #1525 | José Valim | 2012-02-23 | 1 | -0/+6 |
| | | |||||
* | | Remove reference to rails_legacy_mapper, which isn't compatible with 3.2 #5022 | johndouthat | 2012-02-18 | 1 | -2/+1 |
| | | |||||
* | | Fix GH #4720. Routing problem with nested namespace and already camelized ↵ | kennyj | 2012-02-10 | 1 | -0/+5 |
| | | | | | | | | controller option. | ||||
* | | Fixed force_ssl redirects to include original query params | Ryan McGeary | 2012-02-07 | 1 | -0/+1 |
| | | | | | | | | | | | | | | | | | | | | `ActionController.force_ssl` redirects http URLs to their https equivalent; however, when a URL contains a query string, the resulting redirect lacked the original query string. Conflicts: actionpack/lib/action_controller/metal/force_ssl.rb | ||||
* | | Fix url_for method's behavior when it is called with :controller option ↵ | kennyj | 2012-02-07 | 1 | -1/+1 |
| | | | | | | | | | | | | which starts with "/" from multiple nested controller. Closes #3864 | ||||
* | | Merge pull request #3775 from karevn/master | Aaron Patterson | 2012-01-24 | 1 | -1/+2 |
|\ \ | | | | | | | Please pull my changes - they fix a rare problem with tests framework | ||||
| * | | Fix: when using subdomains and constraints, request params were not passed ↵ | karevn | 2011-11-28 | 1 | -1/+2 |
| | | | | | | | | | | | | to constraints callback | ||||
* | | | Added custom regexps to ASTs that have literal nodes on either side of | Aaron Patterson | 2012-01-23 | 1 | -1/+20 |
| | | | | | | | | | | | | symbol nodes. Fixes #4585 | ||||
* | | | We should finalize the routes as soon as possible and not wait for the ↵ | José Valim | 2012-01-06 | 1 | -2/+0 |
| | | | | | | | | | | | | controller to be loaded. | ||||
* | | | Clean up routes inclusion and add some comments for the next soul that ↵ | José Valim | 2012-01-03 | 1 | -30/+37 |
| | | | | | | | | | | | | decides to adventure on this code. | ||||
* | | | be explicit about where helpers are installed | Aaron Patterson | 2011-12-30 | 1 | -1/+1 |
| | | | |||||
* | | | stop using __send__ and just module eval in the extensions | Aaron Patterson | 2011-12-29 | 1 | -3/+2 |
| | | | |||||
* | | | we know the classes will be a list, so *tell* it to respond to each | Aaron Patterson | 2011-12-29 | 1 | -3/+3 |
| | | | | | | | | | | | | rather than casting | ||||
* | | | don't need the begin / end | Aaron Patterson | 2011-12-29 | 1 | -21/+17 |
| | | | |||||
* | | | avoid extra method calls by just defining the delegate | Aaron Patterson | 2011-12-29 | 1 | -2/+3 |
| | | | |||||
* | | | don't use instance eval, just reference variables so we don't have to | Aaron Patterson | 2011-12-29 | 1 | -10/+11 |
| | | | | | | | | | | | | worry about "inspect" marshalling | ||||
* | | | removing dead code. | Aaron Patterson | 2011-12-29 | 1 | -12/+3 |
| | | | |||||
* | | | decouple initialize from clear!. Initialize ivars in initialize, clear | Aaron Patterson | 2011-12-29 | 1 | -5/+5 |
| | | | | | | | | | | | | ivars in clear! | ||||
* | | | modules don't have any instance methods | Aaron Patterson | 2011-12-29 | 1 | -3/+1 |
| | | | |||||
* | | | deprecate String#encoding_aware? and remove its usage | Sergey Nartimov | 2011-12-24 | 1 | -1/+1 |
| | | |