actionpack 1.12.5 → 1.13.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of actionpack might be problematic. Click here for more details.

Files changed (179) hide show
  1. data/CHANGELOG +517 -15
  2. data/MIT-LICENSE +1 -1
  3. data/README +18 -20
  4. data/Rakefile +7 -4
  5. data/examples/address_book_controller.rb +3 -3
  6. data/examples/blog_controller.cgi +3 -3
  7. data/examples/debate_controller.cgi +5 -5
  8. data/lib/action_controller.rb +2 -2
  9. data/lib/action_controller/assertions.rb +73 -311
  10. data/lib/action_controller/{deprecated_assertions.rb → assertions/deprecated_assertions.rb} +32 -8
  11. data/lib/action_controller/assertions/dom_assertions.rb +25 -0
  12. data/lib/action_controller/assertions/model_assertions.rb +12 -0
  13. data/lib/action_controller/assertions/response_assertions.rb +140 -0
  14. data/lib/action_controller/assertions/routing_assertions.rb +82 -0
  15. data/lib/action_controller/assertions/selector_assertions.rb +571 -0
  16. data/lib/action_controller/assertions/tag_assertions.rb +117 -0
  17. data/lib/action_controller/base.rb +334 -163
  18. data/lib/action_controller/benchmarking.rb +3 -6
  19. data/lib/action_controller/caching.rb +83 -22
  20. data/lib/action_controller/cgi_ext/cgi_ext.rb +0 -7
  21. data/lib/action_controller/cgi_ext/cgi_methods.rb +167 -173
  22. data/lib/action_controller/cgi_ext/raw_post_data_fix.rb +43 -22
  23. data/lib/action_controller/cgi_process.rb +50 -27
  24. data/lib/action_controller/components.rb +21 -25
  25. data/lib/action_controller/cookies.rb +10 -9
  26. data/lib/action_controller/{dependencies.rb → deprecated_dependencies.rb} +9 -27
  27. data/lib/action_controller/filters.rb +448 -225
  28. data/lib/action_controller/flash.rb +24 -20
  29. data/lib/action_controller/helpers.rb +2 -5
  30. data/lib/action_controller/integration.rb +40 -16
  31. data/lib/action_controller/layout.rb +11 -8
  32. data/lib/action_controller/macros/auto_complete.rb +3 -2
  33. data/lib/action_controller/macros/in_place_editing.rb +3 -2
  34. data/lib/action_controller/mime_responds.rb +41 -29
  35. data/lib/action_controller/mime_type.rb +68 -10
  36. data/lib/action_controller/pagination.rb +4 -3
  37. data/lib/action_controller/request.rb +22 -14
  38. data/lib/action_controller/rescue.rb +25 -22
  39. data/lib/action_controller/resources.rb +302 -0
  40. data/lib/action_controller/response.rb +20 -2
  41. data/lib/action_controller/response.rb.rej +17 -0
  42. data/lib/action_controller/routing.rb +1165 -567
  43. data/lib/action_controller/scaffolding.rb +30 -31
  44. data/lib/action_controller/session/active_record_store.rb +2 -0
  45. data/lib/action_controller/session/drb_store.rb +4 -0
  46. data/lib/action_controller/session/mem_cache_store.rb +4 -0
  47. data/lib/action_controller/session_management.rb +6 -9
  48. data/lib/action_controller/status_codes.rb +89 -0
  49. data/lib/action_controller/streaming.rb +6 -15
  50. data/lib/action_controller/templates/rescues/_request_and_response.rhtml +5 -5
  51. data/lib/action_controller/templates/rescues/diagnostics.rhtml +2 -2
  52. data/lib/action_controller/templates/rescues/routing_error.rhtml +4 -4
  53. data/lib/action_controller/templates/rescues/template_error.rhtml +1 -1
  54. data/lib/action_controller/templates/scaffolds/list.rhtml +1 -1
  55. data/lib/action_controller/test_process.rb +52 -30
  56. data/lib/action_controller/url_rewriter.rb +63 -29
  57. data/lib/action_controller/vendor/html-scanner/html/document.rb +1 -0
  58. data/lib/action_controller/vendor/html-scanner/html/node.rb +3 -4
  59. data/lib/action_controller/vendor/html-scanner/html/selector.rb +822 -0
  60. data/lib/action_controller/verification.rb +22 -11
  61. data/lib/action_pack.rb +1 -1
  62. data/lib/action_pack/version.rb +2 -2
  63. data/lib/action_view.rb +1 -1
  64. data/lib/action_view/base.rb +46 -43
  65. data/lib/action_view/compiled_templates.rb +1 -1
  66. data/lib/action_view/helpers/active_record_helper.rb +54 -17
  67. data/lib/action_view/helpers/asset_tag_helper.rb +97 -46
  68. data/lib/action_view/helpers/capture_helper.rb +1 -1
  69. data/lib/action_view/helpers/date_helper.rb +258 -136
  70. data/lib/action_view/helpers/debug_helper.rb +1 -1
  71. data/lib/action_view/helpers/deprecated_helper.rb +34 -0
  72. data/lib/action_view/helpers/form_helper.rb +75 -35
  73. data/lib/action_view/helpers/form_options_helper.rb +7 -5
  74. data/lib/action_view/helpers/form_tag_helper.rb +44 -6
  75. data/lib/action_view/helpers/java_script_macros_helper.rb +59 -46
  76. data/lib/action_view/helpers/javascript_helper.rb +71 -10
  77. data/lib/action_view/helpers/javascripts/controls.js +41 -23
  78. data/lib/action_view/helpers/javascripts/dragdrop.js +105 -76
  79. data/lib/action_view/helpers/javascripts/effects.js +293 -163
  80. data/lib/action_view/helpers/javascripts/prototype.js +897 -389
  81. data/lib/action_view/helpers/javascripts/prototype.js.rej +561 -0
  82. data/lib/action_view/helpers/number_helper.rb +111 -65
  83. data/lib/action_view/helpers/prototype_helper.rb +84 -109
  84. data/lib/action_view/helpers/scriptaculous_helper.rb +5 -0
  85. data/lib/action_view/helpers/tag_helper.rb +69 -16
  86. data/lib/action_view/helpers/text_helper.rb +149 -112
  87. data/lib/action_view/helpers/url_helper.rb +200 -107
  88. data/lib/action_view/template_error.rb +66 -42
  89. data/test/abstract_unit.rb +4 -2
  90. data/test/active_record_unit.rb +84 -56
  91. data/test/activerecord/active_record_assertions_test.rb +26 -18
  92. data/test/activerecord/active_record_store_test.rb +4 -36
  93. data/test/activerecord/pagination_test.rb +1 -6
  94. data/test/controller/action_pack_assertions_test.rb +230 -113
  95. data/test/controller/addresses_render_test.rb +2 -6
  96. data/test/controller/assert_select_test.rb +576 -0
  97. data/test/controller/base_test.rb +73 -3
  98. data/test/controller/caching_test.rb +228 -0
  99. data/test/controller/capture_test.rb +12 -10
  100. data/test/controller/cgi_test.rb +89 -12
  101. data/test/controller/components_test.rb +24 -2
  102. data/test/controller/content_type_test.rb +139 -0
  103. data/test/controller/controller_fixtures/app/controllers/admin/user_controller.rb +0 -0
  104. data/test/controller/controller_fixtures/app/controllers/user_controller.rb +0 -0
  105. data/test/controller/controller_fixtures/vendor/plugins/bad_plugin/lib/plugin_controller.rb +0 -0
  106. data/test/controller/cookie_test.rb +33 -25
  107. data/test/controller/deprecated_instance_variables_test.rb +48 -0
  108. data/test/controller/deprecation/deprecated_base_methods_test.rb +60 -0
  109. data/test/controller/fake_controllers.rb +0 -1
  110. data/test/controller/filters_test.rb +301 -16
  111. data/test/controller/flash_test.rb +19 -2
  112. data/test/controller/helper_test.rb +2 -2
  113. data/test/controller/integration_test.rb +154 -0
  114. data/test/controller/layout_test.rb +115 -1
  115. data/test/controller/mime_responds_test.rb +94 -0
  116. data/test/controller/mime_type_test.rb +9 -0
  117. data/test/controller/new_render_test.rb +161 -11
  118. data/test/controller/raw_post_test.rb +52 -15
  119. data/test/controller/redirect_test.rb +27 -14
  120. data/test/controller/render_test.rb +76 -29
  121. data/test/controller/request_test.rb +55 -4
  122. data/test/controller/resources_test.rb +274 -0
  123. data/test/controller/routing_test.rb +1533 -824
  124. data/test/controller/selector_test.rb +628 -0
  125. data/test/controller/send_file_test.rb +9 -1
  126. data/test/controller/session_management_test.rb +51 -0
  127. data/test/controller/test_test.rb +113 -29
  128. data/test/controller/url_rewriter_test.rb +86 -17
  129. data/test/controller/verification_test.rb +19 -17
  130. data/test/controller/webservice_test.rb +0 -7
  131. data/test/fixtures/content_type/render_default_content_types_for_respond_to.rhtml +1 -0
  132. data/test/fixtures/content_type/render_default_for_rhtml.rhtml +1 -0
  133. data/test/fixtures/content_type/render_default_for_rjs.rjs +1 -0
  134. data/test/fixtures/content_type/render_default_for_rxml.rxml +1 -0
  135. data/test/fixtures/deprecated_instance_variables/_cookies_ivar.rhtml +1 -0
  136. data/test/fixtures/deprecated_instance_variables/_cookies_method.rhtml +1 -0
  137. data/test/fixtures/deprecated_instance_variables/_flash_ivar.rhtml +1 -0
  138. data/test/fixtures/deprecated_instance_variables/_flash_method.rhtml +1 -0
  139. data/test/fixtures/deprecated_instance_variables/_headers_ivar.rhtml +1 -0
  140. data/test/fixtures/deprecated_instance_variables/_headers_method.rhtml +1 -0
  141. data/test/fixtures/deprecated_instance_variables/_params_ivar.rhtml +1 -0
  142. data/test/fixtures/deprecated_instance_variables/_params_method.rhtml +1 -0
  143. data/test/fixtures/deprecated_instance_variables/_request_ivar.rhtml +1 -0
  144. data/test/fixtures/deprecated_instance_variables/_request_method.rhtml +1 -0
  145. data/test/fixtures/deprecated_instance_variables/_response_ivar.rhtml +1 -0
  146. data/test/fixtures/deprecated_instance_variables/_response_method.rhtml +1 -0
  147. data/test/fixtures/deprecated_instance_variables/_session_ivar.rhtml +1 -0
  148. data/test/fixtures/deprecated_instance_variables/_session_method.rhtml +1 -0
  149. data/test/fixtures/multipart/binary_file +0 -0
  150. data/test/fixtures/public/javascripts/application.js +1 -0
  151. data/test/fixtures/test/_hello.rxml +1 -0
  152. data/test/fixtures/test/hello_world_container.rxml +3 -0
  153. data/test/fixtures/topic.rb +2 -2
  154. data/test/template/active_record_helper_test.rb +83 -12
  155. data/test/template/asset_tag_helper_test.rb +75 -95
  156. data/test/template/compiled_templates_test.rb +1 -0
  157. data/test/template/date_helper_test.rb +873 -181
  158. data/test/template/deprecated_helper_test.rb +36 -0
  159. data/test/template/deprecated_instance_variables_test.rb +43 -0
  160. data/test/template/form_helper_test.rb +77 -1
  161. data/test/template/form_options_helper_test.rb +4 -0
  162. data/test/template/form_tag_helper_test.rb +66 -2
  163. data/test/template/java_script_macros_helper_test.rb +4 -1
  164. data/test/template/javascript_helper_test.rb +29 -0
  165. data/test/template/number_helper_test.rb +63 -27
  166. data/test/template/prototype_helper_test.rb +77 -34
  167. data/test/template/tag_helper_test.rb +34 -6
  168. data/test/template/text_helper_test.rb +69 -34
  169. data/test/template/url_helper_test.rb +168 -16
  170. data/test/testing_sandbox.rb +7 -22
  171. metadata +66 -20
  172. data/filler.txt +0 -50
  173. data/lib/action_controller/code_generation.rb +0 -235
  174. data/lib/action_controller/vendor/xml_simple.rb +0 -1019
  175. data/test/controller/caching_filestore.rb +0 -74
  176. data/test/fixtures/application_root/app/controllers/a_class_that_contains_a_controller/poorly_placed_controller.rb +0 -7
  177. data/test/fixtures/application_root/app/controllers/module_that_holds_controllers/nested_controller.rb +0 -3
  178. data/test/fixtures/application_root/app/models/a_class_that_contains_a_controller.rb +0 -7
  179. data/test/fixtures/dont_load.rb +0 -3
data/CHANGELOG CHANGED
@@ -1,27 +1,529 @@
1
- *1.12.5* (August 10th, 2006)
1
+ *1.13.0* (January 16th, 2007)
2
2
 
3
- * Updated security fix
3
+ * Modernize cookie testing code, and increase coverage (Heckle++) #7101 [Kevin Clark]
4
4
 
5
+ * Heckling ActionController::Resources::Resource revealed that set_prefixes didn't break when :name_prefix was munged. #7081 [Kevin Clark]
5
6
 
6
- *1.12.4* (August 8th, 2006)
7
+ * Update to Prototype 1.5.0. [Sam Stephenson]
8
+
9
+ * Allow exempt_from_layout :rhtml. #6742, #7026 [dcmanges, Squeegy]
10
+
11
+ * Fix parsing of array[] CGI parameters so extra empty values aren't included. #6252 [Nicholas Seckar, aiwilliams, brentrowland]
12
+
13
+ * link_to_unless_current works with full URLs as well as paths. #6891 [Jarkko Laine, manfred, idrifter]
14
+
15
+ * Fix HTML::Node to output double quotes instead of single quotes. Closes #6845 [mitreandy]
16
+
17
+ * Fix no method error with error_messages_on. Closes #6935 [nik.wakelin Koz]
18
+
19
+ * Slight doc tweak to the ActionView::Helpers::PrototypeHelper#replace docs. Closes #6922 [Steven Bristol]
20
+
21
+ * Slight doc tweak to #prepend_filter. Closes #6493 [Jeremy Voorhis]
22
+
23
+ * Add more extensive documentation to the AssetTagHelper. Closes #6452 [Bob Silva]
24
+
25
+ * Clean up multiple calls to #stringify_keys in TagHelper, add better documentation and testing for TagHelper. Closes #6394 [Bob Silva]
26
+
27
+ * [DOCS] fix reference to ActionController::Macros::AutoComplete for #text_field_with_auto_complete. Closes #2578 [Jan Prill]
28
+
29
+ * Make sure html_document is reset between integration test requests. [ctm]
30
+
31
+ * Set session to an empty hash if :new_session => false and no session cookie or param is present. CGI::Session was raising an unrescued ArgumentError. [Josh Susser]
32
+
33
+ * Fix assert_redirected_to bug where redirecting from a nested to to a top-level controller incorrectly added the current controller's nesting. Closes #6128. [Rick Olson]
34
+
35
+ * Ensure render :json => ... skips the layout. #6808 [Josh Peek]
36
+
37
+ * Silence log_error deprecation warnings from inspecting deprecated instance variables. [Nate Wiger]
38
+
39
+ * Only cache GET requests with a 200 OK response. #6514, #6743 [RSL, anamba]
40
+
41
+ * Correctly report which filter halted the chain. #6699 [Martin Emde]
42
+
43
+ * respond_to recognizes JSON. render :json => @person.to_json automatically sets the content type and takes a :callback option to specify a client-side function to call using the rendered JSON as an argument. #4185 [Scott Raymond, eventualbuddha]
44
+ # application/json response with body 'Element.show({:name: "David"})'
45
+ respond_to do |format|
46
+ format.json { render :json => { :name => "David" }.to_json, :callback => 'Element.show' }
47
+ end
48
+
49
+ * Makes :discard_year work without breaking multi-attribute parsing in AR. #1260, #3800 [sean@ardismg.com, jmartin@desertflood.com, stephen@touset.org, Bob Silva]
50
+
51
+ * Adds html id attribute to date helper elements. #1050, #1382 [mortonda@dgrmm.net, David North, Bob Silva]
52
+
53
+ * Add :index and @auto_index capability to model driven date/time selects. #847, #2655 [moriq, Doug Fales, Bob Silva]
54
+
55
+ * Add :order to datetime_select, select_datetime, and select_date. #1427 [Timothee Peignier, patrick@lenz.sh, Bob Silva]
56
+
57
+ * Added time_select to work with time values in models. Update scaffolding. #2489, #2833 [Justin Palmer, Andre Caum, Bob Silva]
58
+
59
+ * Added :include_seconds to select_datetime, datetime_select and time_select. #2998 [csn, Bob Silva]
60
+
61
+ * All date/datetime selects can now accept an array of month names with :use_month_names. Allows for localization. #363 [tomasj, Bob Silva]
62
+
63
+ * Adds :time_separator to select_time and :date_separator to select_datetime. Preserves BC. #3811 [Bob Silva]
64
+
65
+ * @response.redirect_url works with 201 Created responses: just return headers['Location'] rather than checking the response status. [Jeremy Kemper]
66
+
67
+ * Fixed that HEAD should return the proper Content-Length header (that is, actually use @body.size, not just 0) [DHH]
68
+
69
+ * Added GET-masquarading for HEAD, so request.method will return :get even for HEADs. This will help anyone relying on case request.method to automatically work with HEAD and map.resources will also allow HEADs to all GET actions. Rails automatically throws away the response content in a reply to HEAD, so you don't even need to worry about that. If you, for whatever reason, still need to distinguish between GET and HEAD in some edge case, you can use Request#head? and even Request.headers["REQUEST_METHOD"] for get the "real" answer. Closes #6694 [DHH]
70
+
71
+
72
+ *1.13.0 RC1* (r5619, November 22nd, 2006)
73
+
74
+ * Update Routing to complain when :controller is not specified by a route. Closes #6669. [Nicholas Seckar]
75
+
76
+ * Ensure render_to_string cleans up after itself when an exception is raised. #6658 [rsanheim]
77
+
78
+ * Update to Prototype and script.aculo.us [5579]. [Sam Stephenson, Thomas Fuchs]
79
+
80
+ * simple_format helper doesn't choke on nil. #6644 [jerry426]
81
+
82
+ * Reuse named route helper module between Routing reloads. Use remove_method to delete named route methods after each load. Since the module is never collected, this fixes a significant memory leak. [Nicholas Seckar]
83
+
84
+ * Deprecate standalone components. [Jeremy Kemper]
85
+
86
+ * Always clear model associations from session. #4795 [sd@notso.net, andylien@gmail.com]
87
+
88
+ * Remove JavaScriptLiteral in favor of ActiveSupport::JSON::Variable. [Sam Stephenson]
89
+
90
+ * Sync ActionController::StatusCodes::STATUS_CODES with http://www.iana.org/assignments/http-status-codes. #6586 [dkubb]
91
+
92
+ * Multipart form values may have a content type without being treated as uploaded files if they do not provide a filename. #6401 [Andreas Schwarz, Jeremy Kemper]
93
+
94
+ * assert_response supports symbolic status codes. #6569 [Kevin Clark]
95
+ assert_response :ok
96
+ assert_response :not_found
97
+ assert_response :forbidden
98
+
99
+ * Cache parsed query parameters. #6559 [Stefan Kaes]
100
+
101
+ * Deprecate JavaScriptHelper#update_element_function, which is superseeded by RJS [Thomas Fuchs]
102
+
103
+ * Fix invalid test fixture exposed by stricter Ruby 1.8.5 multipart parsing. #6524 [Bob Silva]
104
+
105
+ * Set ActionView::Base.default_form_builder once rather than passing the :builder option to every form or overriding the form helper methods. [Jeremy Kemper]
106
+
107
+ * Deprecate expire_matched_fragments. Use expire_fragment instead. #6535 [Bob Silva]
108
+
109
+ * Deprecate start_form_tag and end_form_tag. Use form_tag / '</form>' from now on. [Rick]
110
+
111
+ * Added block-usage to PrototypeHelper#form_remote_tag, document block-usage of FormTagHelper#form_tag [Rick]
112
+
113
+ * Add a 0 margin/padding div around the hidden _method input tag that form_tag outputs. [Rick]
114
+
115
+ * Added block-usage to TagHelper#content_tag [DHH]. Example:
116
+
117
+ <% content_tag :div, :class => "strong" %>
118
+ Hello world!
119
+ <% end %>
120
+
121
+ Will output:
122
+ <div class="strong">Hello world!</div>
123
+
124
+ * Deprecated UrlHelper#link_to_image and UrlHelper#link_to :post => true #6409 [BobSilva]
125
+
126
+ * Upgraded NumberHelper with number_to_phone support international formats to comply with ITU E.123 by supporting area codes with less than 3 digits, added precision argument to number_to_human_size (defaults to 1) #6421 [BobSilva]
127
+
128
+ * Fixed that setting RAILS_ASSET_ID to "" should not add a trailing slash after assets #6454 [BobSilva/chrismear]
7
129
 
8
- * Documentation fix: integration test scripts don't require integration_test. #4914 [Frederick Ros <sl33p3r@free.fr>]
130
+ * Force *_url named routes to show the host in ActionView [Rick]
9
131
 
10
- * ActionController::Base Summary documentation rewrite. #4900 [kevin.clark@gmail.com]
132
+ <%= url_for ... %> # no host
133
+ <%= foo_path %> # no host
134
+ <%= foo_url %> # host!
11
135
 
12
- * Fix text_helper.rb documentation rendering. #4725 [Frederick Ros]
136
+ * Add support for converting blocks into function arguments to JavaScriptGenerator#call and JavaScriptProxy#call. [Sam Stephenson]
13
137
 
14
- * Fixes bad rendering of JavaScriptMacrosHelper rdoc. #4910 [Frederick Ros]
138
+ * Add JavaScriptGenerator#literal for wrapping a string in an object whose #to_json is the string itself. [Sam Stephenson]
139
+
140
+ * Add <%= escape_once html %> to escape html while leaving any currently escaped entities alone. Fix button_to double-escaping issue. [Rick]
141
+
142
+ * Fix double-escaped entities, such as &amp;amp;, &amp;#123;, etc. [Rick]
143
+
144
+ * Fix routing to correctly determine when generation fails. Closes #6300. [psross].
145
+
146
+ * Fix broken assert_generates when extra keys are being checked. [Jamis Buck]
147
+
148
+ * Replace KCODE checks with String#chars for truncate. Closes #6385 [Manfred Stienstra]
149
+
150
+ * Make page caching respect the format of the resource that is being requested even if the current route is the default route so that, e.g. posts.rss is not transformed by url_for to '/' and subsequently cached as '/index.html' when it should be cached as '/posts.rss'. [Marcel Molina Jr.]
151
+
152
+ * Use String#chars in TextHelper::excerpt. Closes #6386 [Manfred Stienstra]
153
+
154
+ * Fix relative URL root matching problems. [Mark Imbriaco]
155
+
156
+ * Fix filter skipping in controller subclasses. #5949, #6297, #6299 [Martin Emde]
157
+
158
+ * render_text may optionally append to the response body. render_javascript appends by default. This allows you to chain multiple render :update calls by setting @performed_render = false between them (awaiting a better public API). [Jeremy Kemper]
159
+
160
+ * Rename test assertion to prevent shadowing. Closes #6306. [psross]
161
+
162
+ * Fixed that NumberHelper#number_to_delimiter should respect precision of higher than two digits #6231 [phallstrom]
163
+
164
+ * Fixed that FormHelper#radio_button didn't respect an :id being passed in #6266 [evansj]
165
+
166
+ * Added an html_options hash parameter to javascript_tag() and update_page_tag() helpers #6311 [tzaharia]. Example:
167
+
168
+ update_page_tag :defer => 'true' { |page| ... }
169
+
170
+ Gives:
171
+
172
+ <script defer="true" type="text/javascript">...</script>
173
+
174
+ Which is needed for dealing with the IE6 DOM when it's not yet fully loaded.
175
+
176
+ * Fixed that rescue template path shouldn't be hardcoded, then it's easier to hook in your own #6295 [mnaberez]
177
+
178
+ * Fixed escaping of backslashes in JavaScriptHelper#escape_javascript #6302 [sven@c3d2.de]
179
+
180
+ * Fixed that some 500 rescues would cause 500's themselves because the response had not yet been generated #6329 [cmselmer]
181
+
182
+ * respond_to :html doesn't assume .rhtml. #6281 [Hampton Catlin]
183
+
184
+ * Fixed some deprecation warnings in ActionPack [Rick Olson]
185
+
186
+ * assert_select_rjs decodes escaped unicode chars since the Javascript generators encode them. #6240 [japgolly]
187
+
188
+ * Deprecation: @cookies, @headers, @request, @response will be removed after 1.2. Use the corresponding method instead. [Jeremy Kemper]
189
+
190
+ * Make the :status parameter expand to the default message for that status code if it is an integer. Also support symbol statuses. [Jamis Buck]. Examples:
191
+
192
+ head :status => 404 # expands to "404 Not Found"
193
+ head :status => :not_found # expands to "404 Not Found"
194
+ head :status => :created # expands to "201 Created"
195
+
196
+ * Add head(options = {}) for responses that have no body. [Jamis Buck]. Examples:
197
+
198
+ head :status => 404 # return an empty response with a 404 status
199
+ head :location => person_path(@person), :status => 201
200
+
201
+ * Fix bug that kept any before_filter except the first one from being able to halt the before_filter chain. [Rick Olson]
202
+
203
+ * strip_links is case-insensitive. #6285 [tagoh, Bob Silva]
204
+
205
+ * Clear the cache of possible controllers whenever Routes are reloaded. [Nicholas Seckar]
206
+
207
+ * Filters overhaul including meantime filter support using around filters + blocks. #5949 [Martin Emde, Roman Le Negrate, Stefan Kaes, Jeremy Kemper]
208
+
209
+ * Update CGI process to allow sessions to contain namespaced models. Closes #4638. [dfelstead@site5.com]
210
+
211
+ * Fix routing to respect user provided requirements and defaults when assigning default routing options (such as :action => 'index'). Closes #5950. [Nicholas Seckar]
212
+
213
+ * Rescue Errno::ECONNRESET to handle an unexpectedly closed socket connection. Improves SCGI reliability. #3368, #6226 [sdsykes, fhanshaw@vesaria.com]
214
+
215
+ * Added that respond_to blocks will automatically set the content type to be the same as is requested [DHH]. Examples:
216
+
217
+ respond_to do |format|
218
+ format.html { render :text => "I'm being sent as text/html" }
219
+ format.rss { render :text => "I'm being sent as application/rss+xml" }
220
+ format.atom { render :text => "I'm being sent as application/xml", :content_type => Mime::XML }
221
+ end
222
+
223
+ * Added utf-8 as the default charset for all renders. You can change this default using ActionController::Base.default_charset=(encoding) [DHH]
224
+
225
+ * Added proper getters and setters for content type and charset [DHH]. Example of what we used to do:
226
+
227
+ response.headers["Content-Type"] = "application/atom+xml; charset=utf-8"
228
+
229
+ ...now:
230
+
231
+ response.content_type = Mime::ATOM
232
+ response.charset = "utf-8"
233
+
234
+ * Declare file extensions exempt from layouts. #6219 [brandon]
235
+ Example: ActionController::Base.exempt_from_layout 'rpdf'
236
+
237
+ * Add chained replace/update support for assert_select_rjs [Rick Olson]
238
+
239
+ Given RJS like...
240
+
241
+ page['test1'].replace "<div id=\"1\">foo</div>"
242
+ page['test2'].replace_html "<div id=\"2\">foo</div>"
243
+
244
+ Test it with...
245
+
246
+ assert_select_rjs :chained_replace
247
+ assert_select_rjs :chained_replace, "test1"
248
+
249
+ assert_select_rjs :chained_replace_html
250
+ assert_select_rjs :chained_replace_html, "test2"
251
+
252
+ * Load helpers in alphabetical order for consistency. Resolve cyclic javascript_helper dependency. #6132, #6178 [choonkeat@gmail.com]
253
+
254
+ * Skip params with empty names, such as the &=Save query string from <input type="submit"/>. #2569 [manfred, raphinou@yahoo.com]
255
+
256
+ * Fix assert_tag so that :content => "foo" does not match substrings, but only exact strings. Use :content => /foo/ to match substrings. #2799 [Eric Hodel]
257
+
258
+ * Update JavaScriptGenerator#show/hide/toggle/remove to new Prototype syntax for multiple ids, #6068 [petermichaux@gmail.com]
259
+
260
+ * Update UrlWriter to support :only_path. [Nicholas Seckar, Dave Thomas]
261
+
262
+ * Fixed JavaScriptHelper#link_to_function and JavaScriptHelper#button_to_function to have the script argument be optional [DHH]. So what used to require a nil, like this:
263
+
264
+ link_to("Hider", nil, :class => "hider_link") { |p| p[:something].hide }
265
+
266
+ ...can be written like this:
15
267
 
16
- * Enhance documentation for setting headers in integration tests. Skip auto HTTP prepending when its already there. #4079 [Rick Olson]
268
+ link_to("Hider", :class => "hider_link") { |p| p[:something].hide }
17
269
 
18
- * Documentation for AbstractRequest. #4895 [kevin.clark@gmail.com]
270
+ * Added access to nested attributes in RJS #4548 [richcollins@gmail.com]. Examples:
19
271
 
20
- * Remove all remaining references to @params in the documentation. [Marcel Molina Jr.]
272
+ page['foo']['style'] # => $('foo').style;
273
+ page['foo']['style']['color'] # => $('blank_slate').style.color;
274
+ page['foo']['style']['color'] = 'red' # => $('blank_slate').style.color = 'red';
275
+ page['foo']['style'].color = 'red' # => $('blank_slate').style.color = 'red';
21
276
 
22
- * Add documentation for redirect_to :back's RedirectBackError exception. [Marcel Molina Jr.]
277
+ * Fixed that AssetTagHelper#image_tag and others using compute_public_path should not modify the incoming source argument (closes #5102) [eule@space.ch]
23
278
 
24
- * Update layout and content_for documentation to use yield rather than magic @content_for instance variables. [Marcel Molina Jr.]
279
+ * Deprecated the auto-appending of .png to AssetTagHelper#image_tag calls that doesn't have an extension [DHH]
280
+
281
+ * Fixed FormOptionsHelper#select to respect :selected value #5813
282
+
283
+ * Fixed TextHelper#simple_format to deal with multiple single returns within a single paragraph #5835 [moriq@moriq.com]
284
+
285
+ * Fixed TextHelper#pluralize to handle 1 as a string #5909 [rails@bencurtis.com]
286
+
287
+ * Improved resolution of DateHelper#distance_of_time_in_words for better precision #5994 [Bob Silva]
288
+
289
+ * Changed that uncaught exceptions raised any where in the application will cause RAILS_ROOT/public/500.html to be read and shown instead of just the static "Application error (Rails)" [DHH]
290
+
291
+ * Added deprecation language for pagination which will become a plugin by Rails 2.0 [DHH]
292
+
293
+ * Added deprecation language for in_place_editor and auto_complete_field that both pieces will become plugins by Rails 2.0 [DHH]
294
+
295
+ * Deprecated all of ActionController::Dependencies. All dependency loading is now handled from Active Support [DHH]
296
+
297
+ * Added assert_select* for CSS selector-based testing (deprecates assert_tag) #5936 [assaf.arkin@gmail.com]
298
+
299
+ * radio_button_tag generates unique id attributes. #3353 [Bob Silva, somekool@gmail.com]
300
+
301
+ * strip_tags passes through blank args such as nil or "". #2229, #6702 [duncan@whomwah.com, dharana]
302
+
303
+ * Cleanup assert_tag :children counting. #2181 [jamie@bravenet.com]
304
+
305
+ * button_to accepts :method so you can PUT and DELETE with it. #6005 [Dan Webb]
306
+
307
+ * Update sanitize text helper to strip plaintext tags, and <img src="javascript:bang">. [Rick Olson]
308
+
309
+ * Add routing tests to assert that RoutingError is raised when conditions aren't met. Closes #6016 [Nathan Witmer]
310
+
311
+ * Make auto_link parse a greater subset of valid url formats. [Jamis Buck]
312
+
313
+ * Integration tests: headers beginning with X aren't excluded from the HTTP_ prefix, so X-Requested-With becomes HTTP_X_REQUESTED_WITH as expected. [Mike Clark]
314
+
315
+ * Switch to using FormEncodedPairParser for parsing request parameters. [Nicholas Seckar, DHH]
316
+
317
+ * respond_to .html now always renders #{action_name}.rhtml so that registered custom template handlers do not override it in priority. Custom mime types require a block and throw proper error now. [Tobias Luetke]
318
+
319
+ * Deprecation: test deprecated instance vars in partials. [Jeremy Kemper]
320
+
321
+ * Add UrlWriter to allow writing urls from Mailers and scripts. [Nicholas Seckar]
322
+
323
+ * Relax Routing's anchor pattern warning; it was preventing use of [^/] inside restrictions. [Nicholas Seckar]
324
+
325
+ * Add controller_paths variable to Routing. [Nicholas Seckar]
326
+
327
+ * Fix assert_redirected_to issue with named routes for module controllers. [Rick Olson]
328
+
329
+ * Tweak RoutingError message to show option diffs, not just missing named route significant keys. [Rick Olson]
330
+
331
+ * Invoke method_missing directly on hidden actions. Closes #3030. [Nicholas Seckar]
332
+
333
+ * Add RoutingError exception when RouteSet fails to generate a path from a Named Route. [Rick Olson]
334
+
335
+ * Replace Reloadable with Reloadable::Deprecated. [Nicholas Seckar]
336
+
337
+ * Deprecation: check whether instance variables have been monkeyed with before assigning them to deprecation proxies. Raises a RuntimeError if so. [Jeremy Kemper]
338
+
339
+ * Add support for the param_name parameter to the auto_complete_field helper. #5026 [david.a.williams@gmail.com]
340
+
341
+ * Deprecation! @params, @session, @flash will be removed after 1.2. Use the corresponding instance methods instead. You'll get printed warnings during tests and logged warnings in dev mode when you access either instance variable directly. [Jeremy Kemper]
342
+
343
+ * Make Routing noisy when an anchor regexp is assigned to a segment. #5674 [francois.beausoleil@gmail.com]
344
+
345
+ * Added months and years to the resolution of DateHelper#distance_of_time_in_words, such that "60 days ago" becomes "2 months ago" #5611 [pjhyett@gmail.com]
346
+
347
+ * Make controller_path available as an instance method. #5724 [jmckible@gmail.com]
348
+
349
+ * Update query parser to support adjacent hashes. [Nicholas Seckar]
350
+
351
+ * Make action caching aware of different formats for the same action so that, e.g. foo.xml is cached separately from foo.html. Implicitly set content type when reading in cached content with mime revealing extensions so the entire onous isn't on the webserver. [Marcel Molina Jr.]
352
+
353
+ * Restrict Request Method hacking with ?_method to POST requests. [Rick Olson]
354
+
355
+ * Fixed the new_#{resource}_url route and added named route tests for Simply Restful. [Rick Olson]
356
+
357
+ * Added map.resources from the Simply Restful plugin [DHH]. Examples (the API has changed to use plurals!):
358
+
359
+ map.resources :messages
360
+ map.resources :messages, :comments
361
+ map.resources :messages, :new => { :preview => :post }
362
+
363
+ * Fixed that integration simulation of XHRs should set Accept header as well [Edward Frederick]
364
+
365
+ * TestRequest#reset_session should restore a TestSession, not a hash [Koz]
366
+
367
+ * Don't search a load-path of '.' for controller files [Jamis Buck]
368
+
369
+ * Update integration.rb to require test_process explicitly instead of via Dependencies. [Nicholas Seckar]
370
+
371
+ * Fixed that you can still access the flash after the flash has been reset in reset_session. Closes #5584 [lmarlow@yahoo.com]
372
+
373
+ * Allow form_for and fields_for to work with indexed form inputs. [Jeremy Kemper, Matt Lyon]
374
+
375
+ <% form_for 'post[]', @post do |f| -%>
376
+ <% end -%>
377
+
378
+ * Remove leak in development mode by replacing define_method with module_eval. [Nicholas Seckar]
379
+
380
+ * Provide support for decimal columns to form helpers. Closes #5672. [dave@pragprog.com]
381
+
382
+ * Pass :id => nil or :class => nil to error_messages_for to supress that html attribute. #3586 [olivier_ansaldi@yahoo.com, sebastien@goetzilla.info]
383
+
384
+ * Reset @html_document between requests so assert_tag works. #4810 [jarkko@jlaine.net, easleydp@gmail.com]
385
+
386
+ * Integration tests behave well with render_component. #4632 [edward.frederick@revolution.com, dev.rubyonrails@maxdunn.com]
387
+
388
+ * Added exception handling of missing layouts #5373 [chris@ozmm.org]
389
+
390
+ * Fixed that real files and symlinks should be treated the same when compiling templates #5438 [zachary@panandscan.com]
391
+
392
+ * Fixed that the flash should be reset when reset_session is called #5584 [shugo@ruby-lang.org]
393
+
394
+ * Added special case for "1 Byte" in NumberHelper#number_to_human_size #5593 [murpyh@rubychan.de]
395
+
396
+ * Fixed proper form-encoded parameter parsing for requests with "Content-Type: application/x-www-form-urlencoded; charset=utf-8" (note the presence of a charset directive) [DHH]
397
+
398
+ * Add route_name_path method to generate only the path for a named routes. For example, map.person will add person_path. [Nicholas Seckar]
399
+
400
+ * Avoid naming collision among compiled view methods. [Jeremy Kemper]
401
+
402
+ * Fix CGI extensions when they expect string but get nil in Windows. Closes #5276 [mislav@nippur.irb.hr]
403
+
404
+ * Determine the correct template_root for deeply nested components. #2841 [s.brink@web.de]
405
+
406
+ * Fix that routes with *path segments in the recall can generate URLs. [Rick]
407
+
408
+ * Fix strip_links so that it doesn't hang on multiline <acronym> tags [Jamis Buck]
409
+
410
+ * Remove problematic control chars in rescue template. #5316 [Stefan Kaes]
411
+
412
+ * Make sure passed routing options are not mutated by routing code. #5314 [Blair Zajac]
413
+
414
+ * Make sure changing the controller from foo/bar to bing/bang does not change relative to foo. [Jamis Buck]
415
+
416
+ * Escape the path before routing recognition. #3671
417
+
418
+ * Make sure :id and friends are unescaped properly. #5275 [me@julik.nl]
419
+
420
+ * Rewind readable CGI params so others may reread them (such as CGI::Session when passing the session id in a multipart form). #210 [mklame@atxeu.com, matthew@walker.wattle.id.au]
421
+
422
+ * Added Mime::TEXT (text/plain) and Mime::ICS (text/calendar) as new default types [DHH]
423
+
424
+ * Added Mime::Type.register(string, symbol, synonyms = []) for adding new custom mime types [DHH]. Example: Mime::Type.register("image/gif", :gif)
425
+
426
+ * Added support for Mime objects in render :content_type option [DHH]. Example: render :text => some_atom, :content_type => Mime::ATOM
427
+
428
+ * Add :status option to send_data and send_file. Defaults to '200 OK'. #5243 [Manfred Stienstra <m.stienstra@fngtps.com>]
429
+
430
+ * Routing rewrite. Simpler, faster, easier to understand. The published API for config/routes.rb is unchanged, but nearly everything else is different, so expect breakage in plugins and libs that try to fiddle with routes. [Nicholas Seckar, Jamis Buck]
431
+
432
+ map.connect '/foo/:id', :controller => '...', :action => '...'
433
+ map.connect '/foo/:id.:format', :controller => '...', :action => '...'
434
+ map.connect '/foo/:id', ..., :conditions => { :method => :get }
435
+
436
+ * Cope with missing content type and length headers. Parse parameters from multipart and urlencoded request bodies only. [Jeremy Kemper]
437
+
438
+ * Accept multipart PUT parameters. #5235 [guy.naor@famundo.com]
439
+
440
+ * Added interrogation of params[:format] to determine Accept type. If :format is specified and matches a declared extension, like "rss" or "xml", that mime type will be put in front of the accept handler. This means you can link to the same action from different extensions and use that fact to determine output [DHH]. Example:
441
+
442
+ class WeblogController < ActionController::Base
443
+ def index
444
+ @posts = Post.find :all
445
+
446
+ respond_to do |format|
447
+ format.html
448
+ format.xml { render :xml => @posts.to_xml }
449
+ format.rss { render :action => "feed.rxml" }
450
+ end
451
+ end
452
+ end
453
+
454
+ # returns HTML when requested by a browser, since the browser
455
+ # has the HTML mimetype at the top of its priority list
456
+ Accept: text/html
457
+ GET /weblog
458
+
459
+ # returns the XML
460
+ Accept: application/xml
461
+ GET /weblog
462
+
463
+ # returns the HTML
464
+ Accept: application/xml
465
+ GET /weblog.html
466
+
467
+ # returns the XML
468
+ Accept: text/html
469
+ GET /weblog.xml
470
+
471
+ All this relies on the fact that you have a route that includes .:format.
472
+
473
+ * Expanded :method option in FormTagHelper#form_tag, FormHelper#form_for, PrototypeHelper#remote_form_for, PrototypeHelper#remote_form_tag, and PrototypeHelper#link_to_remote to allow for verbs other than GET and POST by automatically creating a hidden form field named _method, which will simulate the other verbs over post [DHH]
474
+
475
+ * Added :method option to UrlHelper#link_to, which allows for using other verbs than GET for the link. This replaces the :post option, which is now deprecated. Example: link_to "Destroy", person_url(:id => person), :method => :delete [DHH]
476
+
477
+ * follow_redirect doesn't complain about being redirected to the same controller. #5153 [dymo@mk.ukrtelecom.ua]
478
+
479
+ * Add layout attribute to response object with the name of the layout that was rendered, or nil if none rendered. [Kevin Clark kevin.clark@gmail.com]
480
+
481
+ * Fix NoMethodError when parsing params like &&. [Adam Greenfield]
482
+
483
+ * form.text_area handles the :size option just like the original text_area (:size => '60x10' becomes cols="60" rows="10"). [Jeremy Kemper]
484
+
485
+ * Excise ingrown code from FormOptionsHelper#options_for_select. #5008 [anonymous]
486
+
487
+ * Small fix in routing to allow dynamic routes (broken after [4242]) [Rick]
488
+
489
+ map.connect '*path', :controller => 'files', :action => 'show'
490
+
491
+ * Use #flush between switching from #write to #syswrite. Closes #4907. [Blair Zajac <blair@orcaware.com>]
492
+
493
+ * Allow error_messages_for to report errors for multiple objects, as well as support for customizing the name of the object in the error summary header. Closes #4186. [andrew@redlinesoftware.com, Marcel Molina Jr.]
494
+
495
+ error_messages_for :account, :user, :subscription, :object_name => :account
496
+
497
+ * Fix assert_redirected_to tests according to real-world usage. Also, don't fail if you add an extra :controller option: [Rick]
498
+
499
+ redirect_to :action => 'new'
500
+ assert_redirected_to :controller => 'monkeys', :action => 'new'
501
+
502
+ * Diff compared routing options. Allow #assert_recognizes to take a second arg as a hash to specify optional request method [Rick]
503
+
504
+ assert_recognizes({:controller => 'users', :action => 'index'}, 'users')
505
+ assert_recognizes({:controller => 'users', :action => 'create'}, {:path => 'users', :method => :post})
506
+
507
+ * Diff compared options with #assert_redirected_to [Rick]
508
+
509
+ * Add support in routes for semicolon delimited "subpaths", like /books/:id;:action [Jamis Buck]
510
+
511
+ * Change link_to_function and button_to_function to (optionally) take an update_page block instead of a JavaScript string. Closes #4804. [zraii@comcast.net, Sam Stephenson]
512
+
513
+ * Modify routing so that you can say :require => { :method => :post } for a route, and the route will never be selected unless the request method is POST. Only works for route recognition, not for route generation. [Jamis Buck]
514
+
515
+ * Added :add_headers option to verify which merges a hash of name/value pairs into the response's headers hash if the prerequisites cannot be satisfied. [Sam Stephenson]
516
+ ex. verify :only => :speak, :method => :post,
517
+ :render => { :status => 405, :text => "Must be post" },
518
+ :add_headers => { "Allow" => "POST" }
519
+
520
+
521
+ *1.12.5* (August 10th, 2006)
522
+
523
+ * Updated security fix
524
+
525
+
526
+ *1.12.4* (August 8th, 2006)
25
527
 
26
528
  * Cache CgiRequest#request_parameters so that multiple calls don't re-parse multipart data. [Rick]
27
529
 
@@ -1928,7 +2430,7 @@ Default YAML web services were retired, ActionController::Base.param_parsers car
1928
2430
  Before:
1929
2431
 
1930
2432
  module WeblogHelper
1931
- def self.append_features(controller) #:nodoc:
2433
+ def self.included(controller) #:nodoc:
1932
2434
  controller.ancestors.include?(ActionController::Base) ? controller.add_template_helper(self) : super
1933
2435
  end
1934
2436
  end
@@ -2286,9 +2788,9 @@ Default YAML web services were retired, ActionController::Base.param_parsers car
2286
2788
 
2287
2789
  * Added pluralize method to the TextHelper that makes it easy to get strings like "1 message", "3 messages"
2288
2790
 
2289
- * Added proper escaping for the rescues [Andreas Schwartz]
2791
+ * Added proper escaping for the rescues [Andreas Schwarz]
2290
2792
 
2291
- * Added proper escaping for the option and collection tags [Andreas Schwartz]
2793
+ * Added proper escaping for the option and collection tags [Andreas Schwarz]
2292
2794
 
2293
2795
  * Fixed NaN errors on benchmarking [Jim Weirich]
2294
2796