Commit Graph

161 Commits

Author SHA1 Message Date
Cezary Baginski
490a3335d5 Action Pack: fix tests with -K*, work around Ruby 1.9.1 constant lookup.
[#4473 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-25 17:00:20 -07:00
Santiago Pastorino
ed0ca5db9e Add a test for assert_recognizes on ActionDispatch::IntegrationTest [#4390 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-24 15:43:12 -07:00
Diego Carrion
8c7e8976e9 added shorthand support for routes like /projects/status(.:format)
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-17 17:53:08 -07:00
José Valim
86defed5ad Fix a bug in url generation for generic routes. 2010-04-12 20:23:35 +02:00
José Valim
a8b1ca26d7 Ensure match path, :controller => name works as expected. 2010-04-12 16:49:41 +02:00
Santiago Pastorino
5b89fd07b2 Make namespace work with options[:to] [#4351 state:committed]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-11 12:05:43 +02:00
Jeremy Kemper
7353fc1595 Dial back from 'namespace :controller => ...' to 'scope :module => ...' 2010-04-09 23:09:15 -07:00
Jeremy Kemper
561d9eff0c Add test showing root match in path namespace 2010-04-09 22:12:06 -07:00
Jeremy Kemper
ac0280c39d Routes can be selectively namespaced by path or controller module 2010-04-09 21:48:35 -07:00
José Valim
eb063538bd Use config.filter_parameters on in-browser request dump. [#4335 state:resolved] 2010-04-07 01:42:51 +02:00
wycats
b546945b51 Reapply redirect {|params, request| } with passing tests this time 2010-04-04 13:17:14 -07:00
wycats
ab8bf9e152 * Change the object used in routing constraints to be an instance of
ActionDispatch::Request rather than Rack::Request.

* Changed ActionDispatch::Request#method to return a String, to be
  compatible with the Rack::Request superclass.

* Changed ActionDispatch::Request#method to return the original
  method in the case of methodoverride and #request_method not to,
  to be compatible with Rack::Request
2010-04-03 20:24:30 -07:00
José Valim
a0cdb0499e Maintain the usage of :as consistent in the router. Whenever it's supplied, it changes the NAMED ROUTE. If you want to change the PATH, use :path instead. Example: resources :projects, :path => 'projetos' 2010-04-02 19:13:47 +02:00
José Valim
772a0226fd Add a test which ensures slugs in :id work. 2010-03-31 00:19:40 +02:00
Rizwan Reza
cf6734fdf9 Add more tests and docs to uncountable routes. [#3930 state:resolved] 2010-03-28 18:34:48 -07:00
Jan De Poorter
72074aac33 Add _index to named collection routes for uncountable resources (e.g. Sheep)
Signed-off-by: Rizwan Reza <rizwanreza@gmail.com>
2010-03-28 18:34:48 -07:00
wycats
77a2a3d9b3 Request#content_type exists in Rack::Request, and other parts of Rack::Request expect
it to return a String. Split the Rails API so that Request#content_type returns
a String, and Request#content_mime_type returns a Mime::Type object.
2010-03-28 13:40:38 -07:00
Andrew White
e1a70faea6 Add constraints to resources in new routing DSL
Signed-off-by: Rizwan Reza <rizwanreza@gmail.com>
2010-03-28 23:31:13 +04:30
Andrew White
39c35ff04b Fix named routes for member actions of singleton resources [#4266 state:resolved]
Signed-off-by: wycats <wycats@gmail.com>
2010-03-27 00:49:47 -07:00
Andrew White
3d746fcdb5 Add parameter defaults support to new routing DSL [#4265 state:resolved]
Signed-off-by: wycats <wycats@gmail.com>
2010-03-27 00:21:10 -07:00
José Valim
b2c2b0ce45 Rails router automatically calculated for you the controller and named routes in the following scenarios:
match "home/about"                 #=> maps to home#about with named route home_about_path
  match "about"                      #=> does not work because it cannot guess the controller
  match "about" => "home#about"      #=> maps to home#about with named route home_about_path
  match "home/about", :as => "about" #=> maps to home#about with named route about_path
2010-03-26 15:51:51 +01:00
José Valim
4998e097cc Make router shortcuts more polite to URLs starting with a leading slash. 2010-03-22 21:07:37 +01:00
Joshua Peek
13a783672a Install url helpers on module instance so they can be accessed
globally
2010-03-17 16:05:29 -05:00
Jeremy Kemper
b9c48f519f Swear I ran this test 2010-03-15 22:44:49 -07:00
Jeremy Kemper
2a50eabf45 Integration test url options should account for :protocol not just https? 2010-03-15 19:52:41 -07:00
José Valim
839362fa07 Make all AP tests pass for Ruby 1.9.1. 2010-03-12 11:50:45 +01:00
Joshua Peek
1cc2a61ea6 Allow default_url_options to be set on route set 2010-03-09 21:20:13 -06:00
Carlhuda
f38e2e0335 Add support for mount RackApp, :at => "/sprockets" with a shorthand of mount Sprockets => "/sprockets".
This is different from the match syntax in that it cannot be used for controller/action and it does not 
assume an anchor at the end of the match. 

For instance, in the above example, if the client asked for "/sprockets/foo.js", the Sprockets app would
have a SCRIPT_NAME of "/sprockets" and PATH_INFO of "/foo.js".
2010-03-08 12:26:18 -08:00
Jan De Poorter
dfc7ff6429 Make sure nested singular resources get the correct name
[#3911 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-03-07 14:36:26 -08:00
Carl Lerche
57cf1c578a Remove the ability to set the mountpoint when initializing a route set. 2010-03-04 22:17:25 -08:00
Carl Lerche
9a17416d8b Tweak out url_for uses :script_name and add some tests 2010-03-04 22:00:30 -08:00
Carlhuda
786724107c Deprecate IP spoofing settings that are directly on the controller in favor of configuring a middleware 2010-03-03 21:24:00 -08:00
Carlhuda
93422af5d5 Move remote_ip to a middleware:
* ActionController::Base.ip_spoofing_check deprecated => config.action_dispatch.ip_spoofing_check
  * ActionController::Base.trusted_proxies deprecated => config.action_dispatch.trusted_proxies
2010-03-03 21:24:00 -08:00
Carl Lerche
18bcce596e ActionController::Base.use_accept_header is not actually used anymore, so let's deprecate it. 2010-03-03 21:24:00 -08:00
Carl Lerche
fb14b8c6fd ActionDispatch::Request deprecates #request_uri
* Refactored ActionPatch to use fullpath instead
2010-03-03 21:24:00 -08:00
Carlhuda
5e0a05b8cb Tweak the semantic of various URL related methods of ActionDispatch::Request 2010-03-03 21:23:34 -08:00
Carlhuda
bcfb77782b Work on deprecating ActionController::Base.relative_url_root 2010-03-03 15:49:52 -08:00
Carlhuda
98f77e0827 Rename named_url_helpers to url_helpers and url_helpers to url_for 2010-02-26 15:04:50 -08:00
Carlhuda
226dfc2681 WIP: Remove the global router 2010-02-25 17:53:00 -08:00
Martin Schürrer
6bc24d40d5 Use ActionDispatch::Routing everywhere 2010-02-21 13:43:51 -08:00
José Valim
a7b78e86b3 Add a tests which ensures filtered_parameters does not raise an error for a mixed array [#3928 status:resolved] 2010-02-21 14:40:48 +01:00
Joshua Peek
7d7f9ccfdf Reinstate pending tests that were supposed to be fixed before the
beta.

Shout louder this time so they actually get fixed.
2010-02-19 09:34:22 -06:00
José Valim
19787e6259 Should allow symbols in :only and :except in routes. 2010-02-16 22:39:08 +01:00
José Valim
22c0390085 Add a test which ensures namespaced roots. 2010-02-06 11:52:28 +01:00
Mikel Lindsaar
2ebea1c02d deOMGifying Railties, Active Support, and Action Pack 2010-01-31 09:46:30 -08:00
José Valim
8974dac92e Ensure root routes inside optional scopes works as expected. 2010-01-26 00:55:26 +01:00
José Valim
02908e1142 As first step setup the load path and lazy compare middlewares. 2010-01-25 22:59:08 +01:00
José Valim
fc4f237864 Make filter parameters based on request, so they can be modified for anything in the middleware stack. 2010-01-21 16:52:49 +01:00
José Valim
378464a2e4 Default to sync instrumentation. 2010-01-21 13:09:12 +01:00
José Valim
31fddf2ace Tidy up new filter_parameters implementation. 2010-01-21 11:57:24 +01:00