Commit Graph

221 Commits

Author SHA1 Message Date
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
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
291adcd588 Set session options id to nil is respected and cancels lazy loading. 2010-07-18 12:51:03 +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
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
Andrew White
aa31a255c8 Fix syntax of routing tests so they actually run
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-04 18:49:26 +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
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
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
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
wycats
25215d7285 Fix several known web encoding issues:
* Specify accept-charset on all forms. All recent browsers,
  as well as IE5+, will use the encoding specified for form
  parameters
* Unfortunately, IE5+ will not look at accept-charset unless
  at least one character in the form's values is not in the
  page's charset. Since the user can override the default
  charset (which Rails sets to UTF-8), we provide a hidden
  input containing a unicode character, forcing IE to look
  at the accept-charset.
* Now that the vast majority of web input is UTF-8, we set
  the inbound parameters to UTF-8. This will eliminate many
  cases of incompatible encodings between ASCII-8BIT and
  UTF-8.
* You can safely ignore params[:_snowman_]

TODO:

* Validate inbound text to confirm it is UTF-8
* Combine the whole_form implementations in form_helper_test
  and form_tag_helper_test
2010-06-27 21:13:55 -07:00
Jeremy Kemper
f3bb185b03 Upgrade to Rack 1.2.1 2010-06-27 17:55:23 -07:00
Michael Lovitt
ebee77a28a Fixed that an ArgumentError is thrown when request.session_options[:id] is read in the following scenario: when the cookie store is used, and the session contains a serialized object of an unloaded class, and no session data accesses have occurred yet. Pushed the stale_session_check responsibility out of the SessionHash and down into the session store, closer to where the deserialization actually occurs. Added some test coverage for this case and others related to deserialization of unloaded types.
[#4938]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-27 22:39:06 +02:00
Andrew White
d4e1a2ef0d Support optional static segements as well [#4832 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-26 12:02:29 +02:00
Paul Barry
59b24ceb0c Fixed normalize_path in Routing::Mapper to handle optional prefix segments with static and dynamic parts
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-26 12:02:24 +02:00
Andrew White
9a6fc9a540 Don't force pluralization of controller name when defining a resource [#4980 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-26 10:16:30 +02:00
Andrew White
5f64bce10f Failing test for whether glob parameters accept regexps
[#4970 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-25 10:17:28 -07:00
Andrew White
3d8200318a Add failing test case for parameters with periods
[#2536 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-25 10:12:11 -07:00
Prem Sichanugrist
617e94658d Make sure that Rails doesn't resent session_id cookie over and over again if it's already there [#2485 state:resolved]
This apply to only Active Record store and Memcached store, as they both store only the session_id, which will be unchanged, in the cookie.

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-25 09:41:52 +02:00
José Valim
d69ebb849a Avoid deserializing cookies too early, which causes session objects to not be available yet. Unfortunately, could not reproduce this in a test case. 2010-06-24 20:03:03 +02:00
Andrew White
df15ba7ead Fix namespaced redirects [#4389 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-24 13:26:24 +02:00
Michael Lovitt
49f52c3d91 Sessions should not be created until written to and session data should be destroyed on reset.
[#4938]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-23 11:56:35 -07:00
Carlos Antonio da Silva
9651ca751c Add the :path option to match routes when given as symbols. This is specially useful in http helpers for generating routes in scenarios like:
resources :users, :path => 'usuarios' do
    get :search, :on => :collection, :path => 'pesquisar'
  end

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-23 00:49:15 +02:00
José Valim
61317b643a Provive resources_path_names helpers in the router. 2010-06-23 00:43:25 +02:00
Carlos Antonio da Silva
aacb83143f Allow namespace accept options in routes [#4936 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-22 23:37:49 +02:00
José Valim
fef5cf92ed Deprecate :name_prefix in the new router DSL. 2010-06-22 23:30:19 +02:00
Andrew White
1f84061c5c Don't use module to work out shallow name prefix and path as it may not accurately reflect the actual namespace [#4899 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-20 00:15:48 +02:00
Andrew White
65ce3d1297 Accept an object for :constraints option [#4904 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-20 00:15:30 +02:00
Andrew White
bf59717b43 Custom resource routes should be scoped
[#3765]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-19 00:15:06 -07:00
Josh Kalderimis
9d3eeb9053 fix for :shallow in router not generating helpers for create, update, and destroy actions when :only or :except are used
[#4900 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-18 13:59:14 -07:00
Andrew White
6db9558416 Add shallow routing option to new router [#3765 status:committed]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
2010-06-17 09:52:55 -05:00
Rizwan Reza
51ad68367a Added tests for cookies with domain option. 2010-06-11 16:34:53 +02:00
Rizwan Reza
132730d5db Moved test/controller/cookie_test.rb to test/dispatch/cookies_test.rb 2010-06-11 16:34:53 +02:00
Rizwan Reza
edbb78d6cc The previous commit didn't work with complex domains, which is now fixed. 2010-06-11 16:34:52 +02:00
Rizwan Reza
44830ead1c Add support for multi-subdomain session by setting cookie host in session cookie so you can share session between www.example.com, example.com and user.example.com. [#4818 state:resolved]
This reverts commit 330a89072a.
2010-06-11 16:34:52 +02:00
José Valim
330a89072a Revert "Add support for multi-subdomain session by setting cookie host in session cookie so you can share session between www.example.com, example.com and user.example.com. [#4818 state:resolved]"
It does not work for domains like co.uk and com.br.

This reverts commit c4d6245e87.
2010-06-10 20:08:01 +02:00
Guillermo Álvarez
c4d6245e87 Add support for multi-subdomain session by setting cookie host in session cookie so you can share session between www.example.com, example.com and user.example.com. [#4818 state:resolved]
Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
2010-06-10 12:05:12 -04:00
José Valim
5c9f27abaa Add more cases to previous commit [#4394 state:resolved] 2010-06-08 23:26:51 +02:00
Jan De Poorter
4560385fa4 Make sure namespaces are nested within resources
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-08 23:21:53 +02:00
David Heinemeier Hansson
03be27092b Revert "Add shallow routes to the new router" for now. Needs more work.
This reverts commit 67a60ee314.
2010-06-08 16:20:46 -04:00
Prem Sichanugrist
c6ad64394b Make sure that rails recognized the full notation of IPv6 loopback address, and recognize 127.0.0.0/8 in IPv4
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-08 19:45:40 +02:00
Andrew White
a7edddf605 Fix resources ignoring scope options
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-08 19:33:27 +02:00
Andrew White
4740fbac85 Add support for actions on a new resource to the new routing DSL [#4328 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-08 09:11:39 +02:00
Diego Carrion
67a60ee314 Add shallow routes to the new router [Closes #3765] 2010-06-07 18:09:20 -05:00
José Valim
1a8f784a23 member on resource should not expect an ID. 2010-06-07 11:20:54 +02:00