Commit Graph

2965 Commits

Author SHA1 Message Date
wycats
c6160898c8 Replace snowman with utf8=✓ 2010-08-11 18:37:57 -07:00
José Valim & Carlos Antonio da Silva
f08b58dd0c layout_for works again with objects as specified in the documentation and Rails 2.3 [#5357 state:resolved] 2010-08-11 10:23:07 -03:00
wycats
7171161124 rename _snowman to _e 2010-08-09 12:06:25 -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
Piotr Sarnacki
84f0a0bc30 Reload action_methods in AbstractController after defining new method.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-08-04 14:44:34 -03:00
Santiago Pastorino
111234e7c1 Use AS::OrderedHash when trusting in the order of the hash 2010-08-01 21:56:06 -03:00
Carlos Antonio da Silva
11614bddc0 Fix label form helper to use I18n and html options, without the need of 'nil' text param:
Before: f.label :title, nil, :class => 'title'
  After : f.label :title, :class => 'title'

[#5267 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-08-01 21:51:54 -03:00
Santiago Pastorino
fb0bd8c109 Makes form_helper use overriden model accessors
[#3374 state:committed]
2010-08-01 19:32:22 -03:00
Rodrigo Dominguez
aa054c35f7 link_to_function now expects a piece of javascript code for the onclick parameter
[#5179]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2010-07-29 13:11:53 -03:00
Łukasz Strzałkowski
da845275dd Removed deprecated APIs in text and number helpers [#5156 state:resolved]
They're deprecated since 2008. It's time to get rid of them.

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-26 17:26:59 +02:00
Carlos Antonio da Silva
751f89b8b2 Add assertion to link_to_function test with block and capture, and more expressive test name [#5179 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-25 23:00:15 +02: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
Sebastian A. Espindola
8d5b792e7d Fixed output_buffer encoding problem [#5179]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-25 16:33:04 +02:00
Santiago Pastorino
30df88ae06 These tests are trusting in the order of the elements so use OrderedHash instead of Hash 2010-07-21 17:34:43 -07: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
Andrew Kaspick
a1a41a3939 remote_function patch with more detailed test
Signed-off-by: wycats <wycats@gmail.com>
2010-07-21 10:04:55 -07: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
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
Neeraj Singh
33c5689e2d Exceptions from views should be rescued based on the original exception. If a handler for original exception is missing then apply ActiveView::TemplateError
[#2034 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-19 14:50:38 +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
Ivan Torres
cdfa11409c select :include_blank or :prompt should return escaped string [#5099 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-18 11:32:00 +02:00
Miles Egan
d2fae5f78e remove size attribute from tag generated by file_field helper [#5084 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-13 08:30:08 +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
Jeremy Kemper
81f398b804 Fix setting helpers_path to a string or pathname 2010-07-07 12:03:08 -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
Patrik Stenmark
7f7480f6fc Adds tests for content negotiation change introduced in dc5300adb6
Signed-off-by: wycats <wycats@gmail.com>
2010-07-04 11:17:16 -07: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
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
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
Santiago Pastorino
7bd00fcb7f We are trying to test that & escapes here not that &amp; is being escaped, also added a cosmetic change to test_link_tag_with_query_and_no_name
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-29 18:01:32 -07:00
Xavier Noria
ec3bfa2ead s/escape_once/html_escape/, since html safety is the contract that now says whether something has to be escaped 2010-06-30 00:32:26 +02:00
Xavier Noria
cba1460a2f url_for no longer escapes HTML, the :escape option is also gone
Rationale: url_for is just a path/URL generator, it is the responsability of the caller to escape conveniently HTML needs it, JavaScript needs different escaping, a text mail needs no escaping at all, etc.
2010-06-30 00:23:13 +02:00
José Valim
caab176116 Rename _snowman_ to _snowman to be in sync with _method and _csrf_token. 2010-06-29 18:02:39 +02:00
Andrew White
0b6ce34223 Restores the escaping of urls generated from hashes. [#4765 state:resolved]
HTML specifications recommend the escaping of urls in web pages,
which url_for does by default for string urls and consquently
urls generated by path helpers as these return strings.

Hashes passed to url_for are not escaped by default and this
commit reverses this default so that they are escaped.

Undoes the changes of this commit:
1b3195b63c

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 15:35:38 +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
Bruno Michel
2002e5877e Strip_tags never ending attribute should not raise a TypeError [#4870 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 11:40:27 +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
Santiago Pastorino
824da60ae8 Move Rails module to abstract_unit to make test in isolation work
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 01:26:07 +02:00