Commit Graph

568 Commits

Author SHA1 Message Date
Xavier Noria
1ee3593d65 no need to assign if we are gonna return 2010-08-12 00:17:10 +02:00
wycats
6767946374 Improve best_standards_support to use only IE=Edge in development mode 2010-08-09 11:48:31 -07:00
Xavier Noria
4f7565c4de adds missing requires for Object#try 2010-08-09 15:25:21 +02:00
Xavier Noria
4434e407e9 adds URL to the body generated by the redirect macro in the routes mapper as per the RFC, extracts common test pattern into a test macro, adds a test to cover the :status option 2010-08-09 13:31:42 +02:00
Samuel Lebeau
f01184ad9e Avoid potentially expensive inspect call in router. [#4491 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-08-03 11:52:19 +02:00
Xavier Noria
755af49755 edit pass to apply API guideline wrt the use of "# =>" in example code 2010-07-30 02:30:04 +02:00
José Valim
0f0bdaea7b Revert "Avoid uneeded queries in session stores if sid is not given."
First step to merge Rails and Rack session stores. Rack always expects to receive the SID since it may have different behavior if the SID is nil.

This reverts commit e210895ba9.
2010-07-29 09:10:01 +02:00
wycats
aa24ea41d0 Forgot to check in this new file 2010-07-27 20:38:26 -07:00
wycats
123eb25fd1 Add a header that tells Internet Explorer (all versions) to use the best available standards support. This ensures that IE doesn't go into quirks mode because it has been blacklisted by too many users pressing the incompatible button. It also tells IE to use the ChromeFrame renderer, if the user has installed the plugin.
This guarantees that the best available standards support will be used on the client.
2010-07-27 19:25:07 -07:00
Santiago Pastorino
b1cfcedc8f Change returning with tap
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-25 16:33:04 +02:00
Santiago Pastorino
a1e795f554 options could be of any kind of Hash (Hash, HashWithIndifferentAccess or OrderedHash) this way we keep the properties of the options passed as an argument 2010-07-21 17:34:02 -07:00
Mislav Marohnić
efdfcf1325 correct typos in Routing examples 2010-07-22 01:28:30 +02:00
Brian Rose
622092d33e Fixed a globbed route issue where slashes were being escaped, causing assert_routing to fail. [#5135 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-21 22:07:40 +02:00
José Valim
9dfe9fa693 Ensure insert_before in middleware stack raises a meaningful error message [#3679 state:resolved] 2010-07-21 15:17:04 +02:00
Piotr Sarnacki
6807b08099 Moved a few methods from RecordIdentifier to ActiveModel::Naming
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-21 11:29:58 +02:00
Piotr Sarnacki
a63566dda8 Moved PolymorphicRoutes to ActionDispatch::Routing
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-20 23:12:46 +02:00
Bryan Helmkamp
e466354edb Extract ParameterFilter class from FilterParameters mixin
Signed-off-by: wycats <wycats@gmail.com>
2010-07-19 13:44:43 -07:00
José Valim
c3c349ec3e Remove assert_valid. It was already deprecated on Rails 2.3. 2010-07-19 22:35:17 +02:00
José Valim
291adcd588 Set session options id to nil is respected and cancels lazy loading. 2010-07-18 12:51:03 +02:00
José Valim
e210895ba9 Avoid uneeded queries in session stores if sid is not given. 2010-07-18 11:02:08 +02:00
Nick Quaranto
7aec9f9c02 Removing ActionDispatch::Http::FilterParameters#fitered_parameters alias 2010-07-18 06:04:55 +08:00
Xavier Noria
631b9564d2 Merge remote branch 'docrails/master' 2010-07-17 20:00:48 +02:00
Carlos Antonio da Silva
c09cd192aa Small fix in cookie docs and trailing whitespaces 2010-07-15 18:41:29 -03:00
Santiago Pastorino
3952268929 Bump up to rack-mount 0.6.9 and rack-mount-0.6.6.pre removed from action_dispatch vendor 2010-07-15 13:18:44 -07:00
Xavier Noria
6d2e4ee96c Merge remote branch 'docrails/master' 2010-07-13 18:41:09 +02:00
Benjamin Quorning
7e075e6247 Fixed many references to the old config/environment.rb and Rails::Initializer 2010-07-13 13:00:21 +02:00
Santiago Pastorino
d030f830cf Fixes a regression caused by having mapping options controller and action as blank
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-12 19:47:28 +02:00
José Valim
3d7e411953 Routes should respect namespace even if action is a regexp and just controller is given to to. 2010-07-12 15:11:53 +02:00
Steven Hancock
1a35b6215f Removed deprecated |map| block argument from routing docs since it is no longer generated in edge Rails config/routes.rb
Didn't touch plugins guide since I'm not too clear on how routes work in plugins.
2010-07-11 23:57:26 -07:00
Rohit Arondekar
dc364fdc59 API Docs: Fixes to the Routing docs 2010-07-07 22:15:15 -07:00
Andrew White
b802a0d4c7 When a dynamic :controller segment is present in the path add a Regexp constraint that allow matching on multiple path segments.
Using a namespace block isn't compatible with dynamic routes so we
raise an ArgumentError if we detect a :module present in the scope.

[#5052 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-07 00:11:13 +02:00
Andrew White
f4be0041c6 Refactor handling of :only and :except options. The rules are:
1. Don't inherit when specified as an option on a resource
2. Don't push into scope when specified as an option on a resource
2. Resources pull in :only or :except options from scope
3. Either :only or :except in nested scope overwrites parent scope

[#5048 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-06 20:46:20 +02:00
José Valim
8079484b11 Recognize should also work with route is wrapped in a constraint. 2010-07-06 00:39:13 +02:00
José Valim
6671d9cdc1 RouteSet should also handle anonymous classes. 2010-07-05 21:44:49 +02:00
José Valim
a5dda97602 Define a convention for descendants and subclasses.
The former should be symmetric with ancestors and include all children. However, it should not include self since ancestors + descendants should not have duplicated. The latter is symmetric to superclass in the sense it only includes direct children.

By adopting a convention, we expect to have less conflict with other frameworks, as Datamapper. For this moment, to ensure ActiveModel::Validations can be used with Datamapper, we should always call ActiveSupport::DescendantsTracker.descendants(self) internally instead of self.descendants avoiding conflicts.
2010-07-05 13:01:27 +02:00
Andrew White
c6843e2337 Refactor resource options and scoping. Resource classes are now only responsible for controlling how they are named. All other options passed to resources are pushed out to the scope.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-04 13:20:48 +02:00
Wincent Colaiuta
75b32a69a1 Fixes for "router" and "routes" terminology
Commit f7ba614c2d improved the internal consistency of the different
means of accessing routes, but it introduced some problems at the level
of code comments and user-visible strings.

This commit applies fixes on three levels:

Firstly, we remove or replace grammatically invalid constructs such as
"a routes" or "a particular routes".

Secondly, we make sure that we always use "the router DSL" or "the
router syntax", because this has always been the official terminology.

Finally, we make sure that we only use "routes" when referring to the
application-specific set of routes that are defined in the
"config/routes.rb" file, we use "router" when referring on a more
abstract level to "the code in Rails used to handle routing", and we use
"routing" when we need an adjective to apply to nouns such as
"url_helpers. Again this is consistent with historical practice and
other places in the documentation.

Note that this is not a sweep over the entire codebase to ensure
consistent usage of language; it is just a revision of the changes
introduced in commit f7ba614c2d.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-03 22:42:31 +02:00
Andrew White
54250a5bfe Refactor recall parameter normalization [#5021 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-03 10:06:07 +02:00
José Valim
9e6e648732 Fix routes with :controller segment when namespaced [#5034 state:resolved] 2010-07-02 19:13:00 +02:00
Piotr Sarnacki
f7ba614c2d Unify routes naming by renaming router to routes
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-02 01:51:03 +02:00
Aaron Patterson
f8720a04d1 porting session.clear fix to master branch. [#5030 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-07-01 15:17:19 -07:00
José Valim
53b34e8476 Avoid calls to Rails::Application since this is not the official API.
Your application should *always* reference your application const (as Blog::Application) and Rails.application should be used just internally.
2010-07-01 18:43:44 +02:00
José Valim
06681af518 A couple enhancements to the router:
* Allow to use the get :symbol shortcut outside resources scopes as well;

* Fix a bug where :action was not being picked from given options;

* Giving :as option inside a resource now changes just the relative name instead of the full name;
2010-06-30 12:34:15 +02:00
José Valim
ccbb3bb3d8 Clean up the logic to specify the name and path for action a bit. 2010-06-30 11:33:15 +02:00
Jeremy Kemper
ec18719b81 ETag: use body instead of @body since the method will always return a string 2010-06-28 14:46:22 -07:00
José Valim
6dfa8d8e95 Tidy up valid conditions in router a bit. 2010-06-28 16:57:14 +02:00
Andrew White
02a1a4edc8 Add :controller and :action to the list of valid conditions
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 16:51:39 +02:00
Andrew White
e717631a84 Merge :constraints from scope into resource options [#2694 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 14:22:35 +02:00
Andrew White
19ccd4628c Remove invalid conditions from route [#4989 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 12:25:19 +02:00
José Valim
6d04fa6dc4 Deprecate the old router DSL. Since it is still used intensively across ActionPack test suite, patches that translates Rails internal tests to the new router DSL are welcome (note though that a few tests shouldn't be translated since they are testing exactly the old mapper API, like the ones in actionpack/test/controller/resource_test.rb and actionpack/test/controller/routing_test.rb) 2010-06-28 12:23:41 +02:00