aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Merge branch 'master' of github.com:rails/docrails"Vijay Dev2013-08-171-13/+11
| | | | | | | This reverts commit 70d6e16fbad75b89dd1798ed697e7732b8606fa3, reversing changes made to ea4db3bc078fb3093ecdddffdf4f2f4ff3e1e8f9. Seems to be a code merge done by mistake.
* Refactor handling of action normalizationMax Shytikov2013-07-261-11/+13
| | | | | | Reference: Bloody mess internals http://gusiev.com/slides/rails_contribution/static/#40
* Refactor to reduce number of loopsAndrew White2013-07-171-15/+25
| | | | | | Only build the missing_keys array once we have detected that there actually are missing keys by moving the check to be part of the block that performs the path substitution.
* Fix failing test missed for the past year :(Andrew White2013-07-171-2/+17
| | | | | | | | | When optimized path helpers were re-introduced in d7014bc the test added in a328f2f broke but no-one noticed because it wasn't being run by the test suite. Fix the test by checking for nil values or empty strings after the args have been parameterized.
* Fix shorthand routes where controller and action are in the scopeAndrew White2013-06-251-2/+10
| | | | | | | | | Merge `:action` from routing scope and assign endpoint if both `:controller` and `:action` are present. The endpoint assignment only occurs if there is no `:to` present in the options hash so should only affect routes using the shorthand syntax (i.e. endpoint is inferred from the the path). Fixes #9856
* `RoutesInspector` deals with routes using regexp as `:controller` optionYves Senn2013-05-301-1/+1
|
* Add has_named_route? to the mapper APIJosé Valim2013-05-201-0/+5
|
* Fix named routing regression from 3.2.13schneems2013-05-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | When named route that is nested is used in 3.2.13 Example `routes.rb`: ``` resources :nested do resources :builder, :controller => 'nested/builder' end ``` In 3.2.12 and 3.2.12 this named route would work: ``` nested_builder_path(:last_step, :nested_id => "foo") ``` Generating a url that looks like `/nested/foo/builder/last_step`. This PR fixes the regression when building urls via the optimized helper. Any explicit keys set in the options are removed from the list of implicitly mapped keys. Not sure if this is exactly how the original version worked, but this fixes this use case regression.
* Rack::Mount was replaced by Journey, Fixed commentGaurish Sharma2013-04-301-1/+1
|
* extract arrays to constants in MapperVipul A M2013-04-221-2/+4
|
* Duplicate options before mutating themAndrew White2013-04-181-3/+4
|
* Mark unused variables and make some style fixesAgis Anastasopoulos2013-04-082-3/+3
| | | | It'd be a nice convention to mark the unused variables like this, now that Ruby 2 will issue no warnings for such vars being unused.
* Refactoring some reused code into a method (inside of the routeswangjohn2013-04-051-12/+13
| | | | mapper) and adding a constant for all the possible scopes.
* Merge pull request #9932 from senny/9913_routing_problemAndrew White2013-04-031-8/+12
|\ | | | | routing bugfixes when matching multiple paths
| * routing shorthand syntax works with multiple pathsYves Senn2013-03-261-5/+6
| | | | | | | | | | | | Closes #9913. We need to expand the match shorthand syntax for every path.
| * bugfix, when matching multiple paths with `get`, `post`, ...Yves Senn2013-03-261-3/+6
| | | | | | | | | | | | This problem was introduced with: https://github.com/rails/rails/commit/d03aa104e069be4e301efa8cefb90a2a785a7bff
* | fix regression in Mapper when `format:` was used in a `scope`.Yves Senn2013-04-031-1/+1
| | | | | | | | | | | | | | Closes #10071 `#normalize_path!` depends on the options so we need to call `#normalize_options!` first to make sure everything is set correctly.
* | fix wrong argument error messageVipul A M2013-03-311-1/+1
|/
* Tweak exception message to avoid giving potentially misleading suggestionsTrevor Turk2013-03-201-2/+3
|
* Raise an ArgumentError when a clashing named route is definedTrevor Turk2013-03-191-1/+8
|
* Routing match `via` option requirement exception message made more explicitBoris Staal2013-03-051-1/+2
|
* Use custom visitor class for optimized url helpersAndrew White2013-03-031-9/+1
| | | | | | | | Rather than trying to use gsub to remove the optional route segments, which will fail with nested optional segments, use a custom visitor class that returns a empty string for group nodes. Closes #9524
* Remove redundant methodAndrew White2013-02-281-8/+0
|
* `format: true` does not override existing format constraints.Yves Senn2013-02-271-1/+1
| | | | | | | Closes #9466. Passing `format: true` used to override the constraints: { format: /json/ } with `/.+/`. This patch only sets the format if there is no constraint present.
* allow non-String default params in the router.Yves Senn2013-02-261-0/+2
| | | | | | | Closes #9435. Skip valid encoding checks for non-String parameters that come from the matched route's defaults.
* the router allows String contraints.Yves Senn2013-02-261-11/+17
| | | | Closes #9432.
* Allow both a path and an option on root in config/routesSam Ruby2013-02-261-2/+9
|
* determine the match shorthand target early.Yves Senn2013-02-211-14/+12
| | | | | | | | Closes #7554. This patch determines the `controller#action` directly in the `match` method when the shorthand syntax is used. this prevents problems with namespaces and scopes.
* Add missing require to routes inspectorCarlos Antonio da Silva2013-02-191-0/+1
|
* Duck typing is hard. Add header to HtmlTableFormatter.Steve Klabnik2013-02-181-0/+4
| | | | | | | Somehow I missed this method, which was then throwing an error when viewing routes as HTML. Make @rubys happy: ✔
* editorial tweaksXavier Noria2013-02-191-3/+6
|
* use strip_heredoc to keep indentation consistent.Steve Klabnik2013-02-181-12/+12
| | | | Thanks @sikachu. :heart:
* Add message when you have no routes defined.Steve Klabnik2013-02-181-0/+25
| | | | | | Print a message in both `rake routes` and at GET "/rails/info/routes" that lets you know you have no routes defined, as well as linking to the Rails Guide on the topic.
* Add headings to rake routes tableSteve Klabnik2013-02-181-3/+19
|
* the `:controller` option for routes can contain numbers. closes #9231.Yves Senn2013-02-091-1/+1
|
* ruby constant syntax is not supported as routing `:controller` option.Yves Senn2013-02-061-0/+6
| | | | | | | | | | The current implementation only works correctly if you supply the `:controller` with directory notation (eg. `:controller => 'admin/posts'`). The ruby constant notation (eg. `:controller => 'Admin::Posts`) leads to unexpected problems with `url_for`. This patch prints a warning for every non supported `:controller` option. I also added documentation how to work with namespaced controllers. The warning links to that documentation in the rails guide.
* Missing or unneeded require extract_optionsAkira Matsuda2013-02-013-0/+4
|
* remove dead codeAaron Patterson2013-01-301-4/+1
|
* change parameter name for positional argsAaron Patterson2013-01-301-2/+1
|
* nodoc the helper classes, cache stuff for optimized helperAaron Patterson2013-01-301-13/+17
|
* cache path parts in the instanceAaron Patterson2013-01-301-2/+3
|
* stop evaling a string every timeAaron Patterson2013-01-301-4/+4
|
* moving helper classes outside the private blockAaron Patterson2013-01-301-90/+88
|
* pushing specialization down to the optimized classAaron Patterson2013-01-301-23/+25
|
* use polymorphism to remove conditionalAaron Patterson2013-01-301-35/+27
|
* move conditionals to instanceAaron Patterson2013-01-301-6/+16
|
* pull stuff out of the caller and hide in the instanceAaron Patterson2013-01-301-4/+3
|
* moving more stuff on to the instanceAaron Patterson2013-01-301-18/+18
|
* move optimize_helper? to the helper instanceAaron Patterson2013-01-301-9/+12
|
* moving more stuff to the instanceAaron Patterson2013-01-301-6/+6
|