actionpack 3.2.19 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (263) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +850 -401
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +5 -288
  5. data/lib/abstract_controller/asset_paths.rb +2 -2
  6. data/lib/abstract_controller/base.rb +39 -37
  7. data/lib/abstract_controller/callbacks.rb +101 -82
  8. data/lib/abstract_controller/collector.rb +7 -3
  9. data/lib/abstract_controller/helpers.rb +25 -13
  10. data/lib/abstract_controller/layouts.rb +74 -74
  11. data/lib/abstract_controller/logger.rb +1 -2
  12. data/lib/abstract_controller/rendering.rb +30 -13
  13. data/lib/abstract_controller/translation.rb +16 -1
  14. data/lib/abstract_controller/url_for.rb +6 -6
  15. data/lib/abstract_controller/view_paths.rb +1 -1
  16. data/lib/abstract_controller.rb +1 -8
  17. data/lib/action_controller/base.rb +46 -22
  18. data/lib/action_controller/caching/fragments.rb +23 -53
  19. data/lib/action_controller/caching.rb +46 -33
  20. data/lib/action_controller/deprecated/integration_test.rb +3 -0
  21. data/lib/action_controller/deprecated.rb +5 -1
  22. data/lib/action_controller/log_subscriber.rb +16 -8
  23. data/lib/action_controller/metal/conditional_get.rb +76 -32
  24. data/lib/action_controller/metal/data_streaming.rb +20 -26
  25. data/lib/action_controller/metal/exceptions.rb +19 -6
  26. data/lib/action_controller/metal/flash.rb +24 -9
  27. data/lib/action_controller/metal/force_ssl.rb +70 -12
  28. data/lib/action_controller/metal/head.rb +25 -4
  29. data/lib/action_controller/metal/helpers.rb +5 -9
  30. data/lib/action_controller/metal/hide_actions.rb +0 -1
  31. data/lib/action_controller/metal/http_authentication.rb +107 -83
  32. data/lib/action_controller/metal/implicit_render.rb +1 -1
  33. data/lib/action_controller/metal/instrumentation.rb +2 -1
  34. data/lib/action_controller/metal/live.rb +175 -0
  35. data/lib/action_controller/metal/mime_responds.rb +161 -47
  36. data/lib/action_controller/metal/params_wrapper.rb +112 -74
  37. data/lib/action_controller/metal/rack_delegation.rb +9 -3
  38. data/lib/action_controller/metal/redirecting.rb +15 -20
  39. data/lib/action_controller/metal/renderers.rb +11 -9
  40. data/lib/action_controller/metal/rendering.rb +9 -1
  41. data/lib/action_controller/metal/request_forgery_protection.rb +112 -19
  42. data/lib/action_controller/metal/responder.rb +20 -19
  43. data/lib/action_controller/metal/streaming.rb +12 -18
  44. data/lib/action_controller/metal/strong_parameters.rb +520 -0
  45. data/lib/action_controller/metal/testing.rb +13 -18
  46. data/lib/action_controller/metal/url_for.rb +28 -25
  47. data/lib/action_controller/metal.rb +17 -32
  48. data/lib/action_controller/model_naming.rb +12 -0
  49. data/lib/action_controller/railtie.rb +33 -17
  50. data/lib/action_controller/railties/helpers.rb +22 -0
  51. data/lib/action_controller/record_identifier.rb +18 -72
  52. data/lib/action_controller/test_case.rb +251 -131
  53. data/lib/action_controller/vendor/html-scanner.rb +4 -19
  54. data/lib/action_controller.rb +15 -6
  55. data/lib/action_dispatch/http/cache.rb +63 -11
  56. data/lib/action_dispatch/http/filter_parameters.rb +18 -8
  57. data/lib/action_dispatch/http/filter_redirect.rb +37 -0
  58. data/lib/action_dispatch/http/headers.rb +49 -17
  59. data/lib/action_dispatch/http/mime_negotiation.rb +24 -1
  60. data/lib/action_dispatch/http/mime_type.rb +154 -100
  61. data/lib/action_dispatch/http/mime_types.rb +1 -1
  62. data/lib/action_dispatch/http/parameter_filter.rb +44 -46
  63. data/lib/action_dispatch/http/parameters.rb +28 -28
  64. data/lib/action_dispatch/http/rack_cache.rb +2 -3
  65. data/lib/action_dispatch/http/request.rb +64 -18
  66. data/lib/action_dispatch/http/response.rb +130 -35
  67. data/lib/action_dispatch/http/upload.rb +63 -20
  68. data/lib/action_dispatch/http/url.rb +98 -35
  69. data/lib/action_dispatch/journey/backwards.rb +5 -0
  70. data/lib/action_dispatch/journey/formatter.rb +146 -0
  71. data/lib/action_dispatch/journey/gtg/builder.rb +162 -0
  72. data/lib/action_dispatch/journey/gtg/simulator.rb +44 -0
  73. data/lib/action_dispatch/journey/gtg/transition_table.rb +156 -0
  74. data/lib/action_dispatch/journey/nfa/builder.rb +76 -0
  75. data/lib/action_dispatch/journey/nfa/dot.rb +36 -0
  76. data/lib/action_dispatch/journey/nfa/simulator.rb +47 -0
  77. data/lib/action_dispatch/journey/nfa/transition_table.rb +163 -0
  78. data/lib/action_dispatch/journey/nodes/node.rb +124 -0
  79. data/lib/action_dispatch/journey/parser.rb +206 -0
  80. data/lib/action_dispatch/journey/parser.y +47 -0
  81. data/lib/action_dispatch/journey/parser_extras.rb +23 -0
  82. data/lib/action_dispatch/journey/path/pattern.rb +196 -0
  83. data/lib/action_dispatch/journey/route.rb +124 -0
  84. data/lib/action_dispatch/journey/router/strexp.rb +24 -0
  85. data/lib/action_dispatch/journey/router/utils.rb +54 -0
  86. data/lib/action_dispatch/journey/router.rb +166 -0
  87. data/lib/action_dispatch/journey/routes.rb +75 -0
  88. data/lib/action_dispatch/journey/scanner.rb +61 -0
  89. data/lib/action_dispatch/journey/visitors.rb +197 -0
  90. data/lib/action_dispatch/journey/visualizer/fsm.css +34 -0
  91. data/lib/action_dispatch/journey/visualizer/fsm.js +134 -0
  92. data/lib/action_dispatch/journey/visualizer/index.html.erb +52 -0
  93. data/lib/action_dispatch/journey.rb +5 -0
  94. data/lib/action_dispatch/middleware/callbacks.rb +9 -4
  95. data/lib/action_dispatch/middleware/cookies.rb +259 -114
  96. data/lib/action_dispatch/middleware/debug_exceptions.rb +26 -17
  97. data/lib/action_dispatch/middleware/exception_wrapper.rb +29 -3
  98. data/lib/action_dispatch/middleware/flash.rb +58 -58
  99. data/lib/action_dispatch/middleware/params_parser.rb +14 -29
  100. data/lib/action_dispatch/middleware/public_exceptions.rb +30 -14
  101. data/lib/action_dispatch/middleware/reloader.rb +6 -6
  102. data/lib/action_dispatch/middleware/remote_ip.rb +145 -39
  103. data/lib/action_dispatch/middleware/request_id.rb +2 -6
  104. data/lib/action_dispatch/middleware/session/abstract_store.rb +22 -20
  105. data/lib/action_dispatch/middleware/session/cookie_store.rb +82 -28
  106. data/lib/action_dispatch/middleware/session/mem_cache_store.rb +8 -3
  107. data/lib/action_dispatch/middleware/show_exceptions.rb +12 -45
  108. data/lib/action_dispatch/middleware/ssl.rb +70 -0
  109. data/lib/action_dispatch/middleware/stack.rb +6 -1
  110. data/lib/action_dispatch/middleware/static.rb +2 -1
  111. data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb +14 -11
  112. data/lib/action_dispatch/middleware/templates/rescues/_source.erb +25 -0
  113. data/lib/action_dispatch/middleware/templates/rescues/_trace.erb +7 -9
  114. data/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb +15 -9
  115. data/lib/action_dispatch/middleware/templates/rescues/layout.erb +127 -5
  116. data/lib/action_dispatch/middleware/templates/rescues/missing_template.erb +7 -2
  117. data/lib/action_dispatch/middleware/templates/rescues/routing_error.erb +30 -15
  118. data/lib/action_dispatch/middleware/templates/rescues/template_error.erb +39 -13
  119. data/lib/action_dispatch/middleware/templates/rescues/unknown_action.erb +6 -2
  120. data/lib/action_dispatch/middleware/templates/routes/_route.html.erb +16 -0
  121. data/lib/action_dispatch/middleware/templates/routes/_table.html.erb +144 -0
  122. data/lib/action_dispatch/railtie.rb +16 -6
  123. data/lib/action_dispatch/request/session.rb +181 -0
  124. data/lib/action_dispatch/routing/inspector.rb +240 -0
  125. data/lib/action_dispatch/routing/mapper.rb +540 -291
  126. data/lib/action_dispatch/routing/polymorphic_routes.rb +16 -20
  127. data/lib/action_dispatch/routing/redirection.rb +46 -29
  128. data/lib/action_dispatch/routing/route_set.rb +207 -164
  129. data/lib/action_dispatch/routing/routes_proxy.rb +2 -0
  130. data/lib/action_dispatch/routing/url_for.rb +48 -33
  131. data/lib/action_dispatch/routing.rb +48 -83
  132. data/lib/action_dispatch/testing/assertions/dom.rb +3 -13
  133. data/lib/action_dispatch/testing/assertions/response.rb +32 -40
  134. data/lib/action_dispatch/testing/assertions/routing.rb +42 -41
  135. data/lib/action_dispatch/testing/assertions/selector.rb +17 -22
  136. data/lib/action_dispatch/testing/assertions/tag.rb +20 -23
  137. data/lib/action_dispatch/testing/integration.rb +65 -51
  138. data/lib/action_dispatch/testing/test_process.rb +9 -6
  139. data/lib/action_dispatch/testing/test_request.rb +7 -3
  140. data/lib/action_dispatch.rb +21 -15
  141. data/lib/action_pack/version.rb +7 -6
  142. data/lib/action_pack.rb +1 -1
  143. data/lib/action_view/base.rb +15 -34
  144. data/lib/action_view/buffers.rb +7 -1
  145. data/lib/action_view/context.rb +4 -4
  146. data/lib/action_view/dependency_tracker.rb +93 -0
  147. data/lib/action_view/digestor.rb +85 -0
  148. data/lib/action_view/flows.rb +1 -4
  149. data/lib/action_view/helpers/active_model_helper.rb +3 -4
  150. data/lib/action_view/helpers/asset_tag_helper.rb +215 -352
  151. data/lib/action_view/helpers/asset_url_helper.rb +355 -0
  152. data/lib/action_view/helpers/atom_feed_helper.rb +13 -10
  153. data/lib/action_view/helpers/cache_helper.rb +150 -18
  154. data/lib/action_view/helpers/capture_helper.rb +44 -31
  155. data/lib/action_view/helpers/csrf_helper.rb +0 -2
  156. data/lib/action_view/helpers/date_helper.rb +269 -248
  157. data/lib/action_view/helpers/debug_helper.rb +10 -11
  158. data/lib/action_view/helpers/form_helper.rb +931 -537
  159. data/lib/action_view/helpers/form_options_helper.rb +341 -166
  160. data/lib/action_view/helpers/form_tag_helper.rb +190 -90
  161. data/lib/action_view/helpers/javascript_helper.rb +23 -16
  162. data/lib/action_view/helpers/number_helper.rb +148 -329
  163. data/lib/action_view/helpers/output_safety_helper.rb +3 -3
  164. data/lib/action_view/helpers/record_tag_helper.rb +17 -22
  165. data/lib/action_view/helpers/rendering_helper.rb +2 -2
  166. data/lib/action_view/helpers/sanitize_helper.rb +3 -6
  167. data/lib/action_view/helpers/tag_helper.rb +46 -33
  168. data/lib/action_view/helpers/tags/base.rb +147 -0
  169. data/lib/action_view/helpers/tags/check_box.rb +64 -0
  170. data/lib/action_view/helpers/tags/checkable.rb +16 -0
  171. data/lib/action_view/helpers/tags/collection_check_boxes.rb +43 -0
  172. data/lib/action_view/helpers/tags/collection_helpers.rb +83 -0
  173. data/lib/action_view/helpers/tags/collection_radio_buttons.rb +36 -0
  174. data/lib/action_view/helpers/tags/collection_select.rb +28 -0
  175. data/lib/action_view/helpers/tags/color_field.rb +25 -0
  176. data/lib/action_view/helpers/tags/date_field.rb +13 -0
  177. data/lib/action_view/helpers/tags/date_select.rb +72 -0
  178. data/lib/action_view/helpers/tags/datetime_field.rb +22 -0
  179. data/lib/action_view/helpers/tags/datetime_local_field.rb +19 -0
  180. data/lib/action_view/helpers/tags/datetime_select.rb +8 -0
  181. data/lib/action_view/helpers/tags/email_field.rb +8 -0
  182. data/lib/action_view/helpers/tags/file_field.rb +8 -0
  183. data/lib/action_view/helpers/tags/grouped_collection_select.rb +29 -0
  184. data/lib/action_view/helpers/tags/hidden_field.rb +8 -0
  185. data/lib/action_view/helpers/tags/label.rb +65 -0
  186. data/lib/action_view/helpers/tags/month_field.rb +13 -0
  187. data/lib/action_view/helpers/tags/number_field.rb +18 -0
  188. data/lib/action_view/helpers/tags/password_field.rb +12 -0
  189. data/lib/action_view/helpers/tags/radio_button.rb +31 -0
  190. data/lib/action_view/helpers/tags/range_field.rb +8 -0
  191. data/lib/action_view/helpers/tags/search_field.rb +24 -0
  192. data/lib/action_view/helpers/tags/select.rb +40 -0
  193. data/lib/action_view/helpers/tags/tel_field.rb +8 -0
  194. data/lib/action_view/helpers/tags/text_area.rb +18 -0
  195. data/lib/action_view/helpers/tags/text_field.rb +29 -0
  196. data/lib/action_view/helpers/tags/time_field.rb +13 -0
  197. data/lib/action_view/helpers/tags/time_select.rb +8 -0
  198. data/lib/action_view/helpers/tags/time_zone_select.rb +20 -0
  199. data/lib/action_view/helpers/tags/url_field.rb +8 -0
  200. data/lib/action_view/helpers/tags/week_field.rb +13 -0
  201. data/lib/action_view/helpers/tags.rb +39 -0
  202. data/lib/action_view/helpers/text_helper.rb +130 -114
  203. data/lib/action_view/helpers/translation_helper.rb +32 -16
  204. data/lib/action_view/helpers/url_helper.rb +211 -270
  205. data/lib/action_view/helpers.rb +2 -4
  206. data/lib/action_view/locale/en.yml +1 -105
  207. data/lib/action_view/log_subscriber.rb +6 -4
  208. data/lib/action_view/lookup_context.rb +15 -28
  209. data/lib/action_view/model_naming.rb +12 -0
  210. data/lib/action_view/path_set.rb +8 -20
  211. data/lib/action_view/railtie.rb +6 -22
  212. data/lib/action_view/record_identifier.rb +84 -0
  213. data/lib/action_view/renderer/abstract_renderer.rb +25 -19
  214. data/lib/action_view/renderer/partial_renderer.rb +158 -81
  215. data/lib/action_view/renderer/renderer.rb +8 -12
  216. data/lib/action_view/renderer/streaming_template_renderer.rb +2 -5
  217. data/lib/action_view/renderer/template_renderer.rb +12 -10
  218. data/lib/action_view/routing_url_for.rb +107 -0
  219. data/lib/action_view/template/error.rb +22 -12
  220. data/lib/action_view/template/handlers/builder.rb +1 -1
  221. data/lib/action_view/template/handlers/erb.rb +40 -19
  222. data/lib/action_view/template/handlers/raw.rb +11 -0
  223. data/lib/action_view/template/handlers.rb +12 -9
  224. data/lib/action_view/template/resolver.rb +107 -53
  225. data/lib/action_view/template/text.rb +12 -8
  226. data/lib/action_view/template/types.rb +57 -0
  227. data/lib/action_view/template.rb +25 -23
  228. data/lib/action_view/test_case.rb +67 -42
  229. data/lib/{action_controller → action_view}/vendor/html-scanner/html/document.rb +0 -0
  230. data/lib/{action_controller → action_view}/vendor/html-scanner/html/node.rb +12 -12
  231. data/lib/{action_controller → action_view}/vendor/html-scanner/html/sanitizer.rb +13 -2
  232. data/lib/{action_controller → action_view}/vendor/html-scanner/html/selector.rb +9 -9
  233. data/lib/{action_controller → action_view}/vendor/html-scanner/html/tokenizer.rb +1 -1
  234. data/lib/{action_controller → action_view}/vendor/html-scanner/html/version.rb +0 -0
  235. data/lib/action_view/vendor/html-scanner.rb +20 -0
  236. data/lib/action_view.rb +17 -8
  237. metadata +184 -214
  238. data/lib/action_controller/caching/actions.rb +0 -185
  239. data/lib/action_controller/caching/pages.rb +0 -187
  240. data/lib/action_controller/caching/sweeping.rb +0 -97
  241. data/lib/action_controller/deprecated/performance_test.rb +0 -1
  242. data/lib/action_controller/metal/compatibility.rb +0 -65
  243. data/lib/action_controller/metal/session_management.rb +0 -14
  244. data/lib/action_controller/railties/paths.rb +0 -25
  245. data/lib/action_dispatch/middleware/best_standards_support.rb +0 -30
  246. data/lib/action_dispatch/middleware/body_proxy.rb +0 -30
  247. data/lib/action_dispatch/middleware/head.rb +0 -18
  248. data/lib/action_dispatch/middleware/rescue.rb +0 -26
  249. data/lib/action_dispatch/testing/performance_test.rb +0 -10
  250. data/lib/action_view/asset_paths.rb +0 -142
  251. data/lib/action_view/helpers/asset_paths.rb +0 -7
  252. data/lib/action_view/helpers/asset_tag_helpers/asset_include_tag.rb +0 -146
  253. data/lib/action_view/helpers/asset_tag_helpers/asset_paths.rb +0 -93
  254. data/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb +0 -193
  255. data/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb +0 -148
  256. data/lib/sprockets/assets.rake +0 -99
  257. data/lib/sprockets/bootstrap.rb +0 -37
  258. data/lib/sprockets/compressors.rb +0 -83
  259. data/lib/sprockets/helpers/isolated_helper.rb +0 -13
  260. data/lib/sprockets/helpers/rails_helper.rb +0 -182
  261. data/lib/sprockets/helpers.rb +0 -6
  262. data/lib/sprockets/railtie.rb +0 -62
  263. data/lib/sprockets/static_compiler.rb +0 -56
data/CHANGELOG.md CHANGED
@@ -1,389 +1,693 @@
1
- ## Rails 3.2.19 (Jul 2, 2014) ##
1
+ ## Rails 4.0.0 (June 25, 2013) ##
2
2
 
3
- * Fix regression when using `ActionView::Helpers::TranslationHelper#translate` with
4
- `options[:raise]`.
3
+ * Merge `:action` from routing scope and assign endpoint if both `:controller`
4
+ and `:action` are present. The endpoint assignment only occurs if there is
5
+ no `:to` present in the options hash so should only affect routes using the
6
+ shorthand syntax (i.e. endpoint is inferred from the the path).
5
7
 
6
- This regression was introduced at ec16ba75a5493b9da972eea08bae630eba35b62f.
8
+ Fixes #9856
7
9
 
8
- *Shota Fukumori (sora_h)*
10
+ *Yves Senn*, *Andrew White*
9
11
 
12
+ * Use a case insensitive URI Regexp for #asset_path.
10
13
 
11
- ## Rails 3.2.18 (May 6, 2014) ##
14
+ This fix a problem where the same asset path using different case are generating
15
+ different URIs.
12
16
 
13
- * Only accept actions without File::SEPARATOR in the name.
17
+ Before:
14
18
 
15
- This will avoid directory traversal in implicit render.
19
+ image_tag("HTTP://google.com")
20
+ # => "<img alt=\"Google\" src=\"/assets/HTTP://google.com\" />"
21
+ image_tag("http://google.com")
22
+ # => "<img alt=\"Google\" src=\"http://google.com\" />"
16
23
 
17
- Fixes: CVE-2014-0130
24
+ After:
18
25
 
19
- *Rafael Mendonça França*
26
+ image_tag("HTTP://google.com")
27
+ # => "<img alt=\"Google\" src=\"HTTP://google.com\" />"
28
+ image_tag("http://google.com")
29
+ # => "<img alt=\"Google\" src=\"http://google.com\" />"
20
30
 
31
+ *David Celis*
21
32
 
22
- ## Rails 3.2.17 (Feb 18, 2014) ##
33
+ * Fix an issue where partials with a number in the filename weren't being digested for cache dependencies.
23
34
 
24
- * Use the reference for the mime type to get the format
35
+ *Bryan Ricker*
25
36
 
26
- Fixes: CVE-2014-0082
37
+ * Add support for passing custom url options other than `:host` and custom
38
+ status and flash options to `force_ssl`.
27
39
 
28
- * Escape format, negative_format and units options of number helpers
40
+ *Andrew White*
29
41
 
30
- Fixes: CVE-2014-0081
42
+ * The `force_ssl` command now builds the redirect url from `request.fullpath`.
43
+ This ensures that the format is maintained and it doesn't redirect to a route
44
+ that has the same parameters but is defined earlier in `routes.rb`. Also any
45
+ optional segments are maintained.
31
46
 
47
+ Fixes #7528, #9061, #10305.
32
48
 
33
- ## Rails 3.2.16 (Dec 12, 2013) ##
49
+ *Andrew White*
34
50
 
35
- * Deep Munge the parameters for GET and POST Fixes CVE-2013-6417
51
+ * Return a 405 Method Not Allowed response when a request contains an unknown
52
+ HTTP method.
36
53
 
37
- * Stop using i18n's built in HTML error handling. Fixes: CVE-2013-4491
54
+ *Lewis Marshall*
38
55
 
39
- * Escape the unit value provided to number_to_currency Fixes CVE-2013-6415
56
+ * Add support for extracting the port from the `:host` option passed to `url_for`.
40
57
 
41
- * Only use valid mime type symbols as cache keys CVE-2013-6414
58
+ *Andrew White*
42
59
 
43
- ## Rails 3.2.15 (Oct 16, 2013) ##
60
+ * Add support for removing the subdomain from a url by passing `nil`, `false` or `''`.
61
+ Fixes #10180.
44
62
 
45
- * Fix `ActionDispatch::RemoteIp::GetIp#calculate_ip` to only check for spoofing
46
- attacks if both `HTTP_CLIENT_IP` and `HTTP_X_FORWARDED_FOR` are set.
63
+ *Derek Watson + Andrew White*
47
64
 
48
- Fixes #12410
49
- Backports #10844
65
+ * Element of the collection for `options_from_collection_for_select` helper can
66
+ optionally contain html attributes as the last element of the array as
67
+ `options_for_select` helper.
50
68
 
51
- *Tamir Duberstein*
69
+ *Vasiliy Ermolovich*
52
70
 
53
- * Fix the assert_recognizes test method so that it works when there are
54
- constraints on the querystring.
71
+ * Fix explicit names on multiple file fields. If a file field tag has
72
+ the multiple option, it is turned into an array field (appending `[]`),
73
+ but if an explicit name is passed to `file_field` the `[]` is not
74
+ appended.
75
+ Fixes #9830.
55
76
 
56
- Issue/Pull Request #9368
57
- Backport #5219
77
+ *Ryan McGeary*
58
78
 
59
- *Brian Hahn*
79
+ * Add block support for the `mail_to` helper, similar to the `link_to` helper.
60
80
 
61
- * Fix to render partial by context(#11605).
81
+ *Sam Pohlenz*
62
82
 
63
- *Kassio Borges*
83
+ * Automatically configure cookie-based sessions to be encrypted if
84
+ `secret_key_base` is set, falling back to signed if only `secret_token`
85
+ is set. Automatically upgrade existing signed cookie-based sessions from
86
+ Rails 3.x to be encrypted if both `secret_key_base` and `secret_token`
87
+ are set, or signed with the new key generator if only `secret_token` is
88
+ set. This leaves only the `config.session_store :cookie_store` option and
89
+ removes the two new options introduced in 4.0.0.beta1:
90
+ `encrypted_cookie_store` and `upgrade_signature_to_encryption_cookie_store`.
64
91
 
65
- * Fix `ActionDispatch::Assertions::ResponseAssertions#assert_redirected_to`
66
- does not show user-supplied message.
92
+ *Trevor Turk*
67
93
 
68
- Issue: when `assert_redirected_to` fails due to the response redirect not
69
- matching the expected redirect the user-supplied message (second parameter)
70
- is not shown. This message is only shown if the response is not a redirect.
94
+ * Ensure consistent fallback to the default layout lookup for layouts set
95
+ using symbols or procs that return `nil`.
71
96
 
72
- *Alexey Chernenkov*
97
+ All of the following layouts will result in the default layout lookup:
73
98
 
99
+ layout nil
74
100
 
75
- ## Rails 3.2.14 (Jul 22, 2013) ##
101
+ layout proc { nil }
76
102
 
77
- * Merge `:action` from routing scope and assign endpoint if both `:controller`
78
- and `:action` are present. The endpoint assignment only occurs if there is
79
- no `:to` present in the options hash so should only affect routes using the
80
- shorthand syntax (i.e. endpoint is inferred from the the path).
103
+ layout :returns_nil
104
+ def returns_nil
105
+ nil
106
+ end
81
107
 
82
- Fixes #9856
108
+ Previously symbols and procs which returned `nil` resulted in no layout which
109
+ differed from the `layout nil` behavior. To get the "no layout" behavior just
110
+ return `false` instead of `nil` for `layout`.
83
111
 
84
- *Yves Senn*, *Andrew White*
112
+ *Chris Nicola*
85
113
 
86
- * Always escape the result of `link_to_unless` method.
114
+ * Create `UpgradeLegacySignedCookieJar` to transparently upgrade existing signed
115
+ cookies generated by Rails 3.x to avoid invalidating them when upgrading to Rails 4.x.
87
116
 
88
- Before:
117
+ *Trevor Turk + Neeraj Singh*
89
118
 
90
- link_to_unless(true, '<b>Showing</b>', 'github.com')
91
- # => "<b>Showing</b>"
119
+ * Raise an `ArgumentError` when a clashing named route is defined.
92
120
 
93
- After:
121
+ *Trevor Turk*
94
122
 
95
- link_to_unless(true, '<b>Showing</b>', 'github.com')
96
- # => "&lt;b&gt;Showing&lt;/b&gt;"
123
+ * Allow default url options to accept host with protocol such as `http://`
97
124
 
98
- *dtaniwaki*
125
+ config.action_mailer.default_url_options = { host: "http://mydomain.com" }
99
126
 
100
- * Use a case insensitive URI Regexp for #asset_path.
127
+ *Richard Schneeman*
101
128
 
102
- This fix a problem where the same asset path using different case are generating
103
- different URIs.
129
+ * Ensure that digest authentication responds with a 401 status when a basic
130
+ header is received.
104
131
 
105
- Before:
132
+ *Brad Dunbar*
106
133
 
107
- image_tag("HTTP://google.com")
108
- # => "<img alt=\"Google\" src=\"/assets/HTTP://google.com\" />"
109
- image_tag("http://google.com")
110
- # => "<img alt=\"Google\" src=\"http://google.com\" />"
134
+ * Include I18n locale fallbacks in view lookup.
135
+ Fixes #3512.
111
136
 
112
- After:
137
+ *Juan Barreneche*
113
138
 
114
- image_tag("HTTP://google.com")
115
- # => "<img alt=\"Google\" src=\"HTTP://google.com\" />"
116
- image_tag("http://google.com")
117
- # => "<img alt=\"Google\" src=\"http://google.com\" />"
139
+ * Integration and functional tests allow headers and rack env
140
+ variables to be passed when performing requests.
141
+ Fixes #6513.
118
142
 
119
- *David Celis + Rafael Mendonça França*
143
+ Example:
120
144
 
121
- * Fix explicit names on multiple file fields. If a file field tag has
122
- the multiple option, it is turned into an array field (appending `[]`),
123
- but if an explicit name is passed to `file_field` the `[]` is not
124
- appended.
125
- Fixes #9830.
145
+ # integration test
146
+ get "/success", {}, "HTTP_REFERER" => "http://test.com/",
147
+ "Accepts" => "text/plain, text/html"
126
148
 
127
- *Ryan McGeary*
149
+ # functional test
150
+ @request.headers["Accepts"] = "text/plain, text/html"
128
151
 
129
- * Fix assets loading performance in 3.2.13.
152
+ *Yves Senn*
130
153
 
131
- Issue #8756 uses Sprockets for resolving files that already exist on disk,
132
- for those files their extensions don't need to be rewritten.
154
+ * Http::Headers respects headers that are not prefixed with HTTP_
133
155
 
134
- Fixes #9803.
156
+ *Yves Senn*
135
157
 
136
- *Fred Wu*
158
+ * Fix incorrectly appended square brackets to a multiple select box
159
+ if an explicit name has been given and it already ends with "[]"
137
160
 
138
- * Fix `ActionController#action_missing` not being called.
139
- Fixes #9799.
161
+ Before:
140
162
 
141
- *Janko Luin*
163
+ select(:category, [], {}, multiple: true, name: "post[category][]")
164
+ # => <select name="post[category][][]" ...>
142
165
 
143
- * `ActionView::Helpers::NumberHelper#number_to_human` returns the number unaltered when
144
- the units hash does not contain the needed key, e.g. when the number provided is less
145
- than the largest key provided.
166
+ After:
146
167
 
147
- Examples:
168
+ select(:category, [], {}, multiple: true, name: "post[category][]")
169
+ # => <select name="post[category][]" ...>
148
170
 
149
- number_to_human(123, units: {}) # => 123
150
- number_to_human(123, units: { thousand: 'k' }) # => 123
171
+ *Olek Janiszewski*
151
172
 
152
- Fixes #9269.
153
- Backport #9347.
173
+ * Fixed regression when using `assert_template` to verify files sent using
174
+ `render file: 'README.md'`.
175
+ Fixes #9464.
154
176
 
155
- *Michael Hoffman*
177
+ *Justin Coyne*
156
178
 
157
- * Include I18n locale fallbacks in view lookup.
158
- Fixes GH#3512.
179
+ * Fixed `ActionView::Helpers::CaptureHelper#content_for` regression when trying to use it in
180
+ a boolean statement.
181
+ Fixes #9360.
159
182
 
160
- *Juan Barreneche*
183
+ *Nikolay Shebanov*
161
184
 
162
- * Fix `ActionDispatch::Request#formats` when the Accept request-header is an
163
- empty string. Fix #7774 [Backport #8977, #9541]
185
+ * `format: true` does not override existing format constraints.
186
+ Fixes #9466.
164
187
 
165
- *Soylent + Maxime Réty*
188
+ Example:
166
189
 
190
+ # This will force the .json extension.
191
+ get '/json_only', to: ok, format: true, constraints: { format: /json/ }
167
192
 
168
- ## Rails 3.2.13 (Mar 18, 2013) ##
193
+ *Yves Senn*
169
194
 
170
- * Fix incorrectly appended square brackets to a multiple select box
171
- if an explicit name has been given and it already ends with "[]".
195
+ * Skip valid encoding checks for non-String parameters that come
196
+ from the matched route's defaults.
197
+ Fixes #9435.
172
198
 
173
- Before:
199
+ Example:
174
200
 
175
- select(:category, [], {}, multiple: true, name: "post[category][]")
176
- # => <select name="post[category][][]" ...>
201
+ root to: 'main#posts', page: 1
177
202
 
178
- After:
203
+ *Yves Senn*
179
204
 
180
- select(:category, [], {}, multiple: true, name: "post[category][]")
181
- # => <select name="post[category][]" ...>
205
+ * Don't verify Regexp requirements for non-Regexp `:constraints`.
206
+ Fixes #9432.
207
+
208
+ Example:
182
209
 
183
- Backport #9616.
210
+ get '/photos.:format' => 'feeds#photos', constraints: {format: 'xml'}
184
211
 
185
- *Olek Janiszewski*
212
+ *Yves Senn*
213
+
214
+ * Make `ActionDispatch::Journey::Path::Pattern#new` raise more meaningful exception message.
215
+
216
+ *Thierry Zires*
217
+
218
+ * Fix `respond_to` not using formats that have no block if all is present. *Michael Grosser*
219
+
220
+ * New applications use an encrypted session store by default.
221
+
222
+ *Santiago Pastorino*
186
223
 
187
224
  * Determine the controller#action from only the matched path when using the
188
225
  shorthand syntax. Previously the complete path was used, which led
189
226
  to problems with nesting (scopes and namespaces).
190
227
  Fixes #7554.
191
- Backport #9361.
192
228
 
193
229
  Example:
194
230
 
195
- # this will route to questions#new
231
+ # This will route to questions#new.
196
232
  scope ':locale' do
197
233
  get 'questions/new'
198
234
  end
199
235
 
200
236
  *Yves Senn*
201
237
 
202
- * Fix `assert_template` with `render :stream => true`.
203
- Fix #1743.
204
- Backport #5288.
238
+ * Remove support for parsing XML parameters from request. If you still want to parse XML
239
+ parameters, please install `actionpack-xml_parser' gem.
205
240
 
206
- *Sergey Nartimov*
241
+ *Prem Sichanugrist*
242
+
243
+ * Remove support for parsing YAML parameters from request.
244
+
245
+ *Aaron Patterson*
246
+
247
+ * Add a message when you have no routes defined to both `rake routes` and
248
+ GET "/rails/info/routes" that lets you know you have none defined and links
249
+ to the Rails guide on the topic.
250
+
251
+ *Steve Klabnik*
252
+
253
+ * Change `image_alt` method to replace underscores/hyphens to spaces in filenames.
207
254
 
208
- * Eagerly populate the http method lookup cache so local project inflections do
209
- not interfere with use of underscore method ( and we don't need locks )
255
+ Previously, underscored filenames became `alt="A_long_file_name_with_underscores"`
256
+ in HTML, which is poor for accessibility. For instance, Apple's VoiceOver Utility
257
+ pronounces each underscore. `A_long_file_name` thus would be read as `A underscore
258
+ long underscore file underscore name.` Now underscored or hyphenated filenames
259
+ (both of which are very popular naming conventions) read more naturally in
260
+ screen readers by converting both hyphens and underscores to spaces.
210
261
 
211
- *Aditya Sanghi*
262
+ Before:
263
+
264
+ image_tag('underscored_file_name.png')
265
+ # => <img alt="Underscored_file_name" src="/assets/underscored_file_name.png" />
266
+
267
+ After:
268
+
269
+ image_tag('underscored_file_name.png')
270
+ # => <img alt="Underscored file name" src="/assets/underscored_file_name.png" />
271
+
272
+ *Nick Cox*
273
+
274
+ * We don't support Ruby constant notation in the `:controller` option for route
275
+ definitions. So, this raises an `ArgumentError` now:
276
+
277
+ resources :posts, controller: "Admin::Posts" # WRONG
278
+
279
+ Use path notation instead:
280
+
281
+ resources :posts, controller: "admin/posts" # RIGHT
212
282
 
213
- * `BestStandardsSupport` no longer duplicates `X-UA-Compatible` values on
214
- each request to prevent header size from blowing up.
283
+ *Yves Senn*
284
+
285
+ * `assert_template` can be used to verify the locals of partials,
286
+ which live inside a directory.
287
+
288
+ # Prefixed partials inside directories worked and still work.
289
+ assert_template partial: 'directory/_partial', locals: {name: 'John'}
290
+
291
+ # This did not work but does now.
292
+ assert_template partial: 'directory/partial', locals: {name: 'John'}
293
+
294
+ Fixes #8516.
215
295
 
216
- *Edward Anderson*
296
+ *Yves Senn*
297
+
298
+ * Fix `content_tag_for` with array HTML option.
299
+ It would embed array as string instead of joining it like `content_tag` does:
300
+
301
+ content_tag(:td, class: ["foo", "bar"]){}
302
+ # => <td class="foo bar"></td>
303
+
304
+ Before:
305
+
306
+ content_tag_for(:td, item, class: ["foo", "bar"])
307
+ # => <td class="item [&quot;foo&quot;, &quot;bar&quot;]" id="item_1"></td>
308
+
309
+ After:
310
+
311
+ content_tag_for(:td, item, class: ["foo", "bar"])
312
+ # => <td class="item foo bar" id="item_1"></td>
313
+
314
+ *Semyon Perepelitsa*
315
+
316
+ * Remove `BestStandardsSupport` middleware, !DOCTYPE html already triggers
317
+ standards mode per http://msdn.microsoft.com/en-us/library/jj676915(v=vs.85).aspx
318
+ and ChromeFrame header has been moved to `config.action_dispatch.default_headers`
319
+
320
+ *Guillermo Iguaran*
321
+
322
+ * Fix CSRF protection and `current_url?` helper to work with HEAD requests
323
+ now that `ActionDispatch::Head` has been removed in favor of `Rack::Head`.
324
+
325
+ *Michiel Sikkes*
326
+
327
+ * Change `asset_path` to not include `SCRIPT_NAME` when it's used
328
+ from a mounted engine. Fixes #8119.
329
+
330
+ *Piotr Sarnacki*
331
+
332
+ * Add JavaScript based routing path matcher to `/rails/info/routes`.
333
+ Routes can now be filtered by whether or not they match a path.
334
+
335
+ *Richard Schneeman*
336
+
337
+ * Change the behavior of route defaults so that explicit defaults are no longer
338
+ required where the key is not part of the path. For example:
339
+
340
+ resources :posts, bucket_type: 'posts'
341
+
342
+ will be required whenever constructing the url from a hash such as a functional
343
+ test or using `url_for` directly. However using the explicit form alters the
344
+ behavior so it's not required:
345
+
346
+ resources :projects, defaults: { bucket_type: 'projects' }
347
+
348
+ This changes existing behavior slightly in that any routes which only differ
349
+ in their defaults will match the first route rather than the closest match.
350
+
351
+ *Andrew White*
352
+
353
+ * Add support for routing constraints other than Regexp and String.
354
+ For example this now allows the use of arrays like this:
355
+
356
+ get '/foo/:action', to: 'foo', constraints: { subdomain: %w[www admin] }
357
+
358
+ or constraints where the request method returns an Fixnum like this:
359
+
360
+ get '/foo', to: 'foo#index', constraints: { port: 8080 }
361
+
362
+ Note that this only applies to constraints on the request - path constraints
363
+ still need to be specified as Regexps as the various constraints are compiled
364
+ into a single Regexp.
365
+
366
+ *Andrew White*
367
+
368
+ * Fix a bug in integration tests where setting the port via a url passed to
369
+ the process method was ignored when constructing the request environment.
370
+
371
+ *Andrew White*
372
+
373
+ * Allow `:selected` to be set on `date_select` tag helper.
374
+
375
+ *Colin Burn-Murdoch*
217
376
 
218
377
  * Fixed JSON params parsing regression for non-object JSON content.
219
378
 
220
379
  *Dylan Smith*
221
380
 
222
- * Prevent unnecessary asset compilation when using `javascript_include_tag` on
223
- files with non-standard extensions.
381
+ * Extract `ActionDispatch::PerformanceTest` into https://github.com/rails/rails-perftest
382
+ You can add the gem to your Gemfile to keep using performance tests.
383
+
384
+ gem 'rails-perftest'
385
+
386
+ *Yves Senn*
224
387
 
225
- *Noah Silas*
388
+ * Added view_cache_dependency API for declaring dependencies that affect
389
+ cache digest computation.
226
390
 
227
- * Fixes issue where duplicate assets can be required with sprockets.
391
+ *Jamis Buck*
228
392
 
229
- *Jeremy Jackson*
393
+ * `image_submit_tag` will set `alt` attribute from image source if not
394
+ specified.
230
395
 
231
- * Bump `rack` dependency to 1.4.3, eliminate `Rack::File` headers deprecation warning.
396
+ *Nihad Abbasov*
232
397
 
233
- *Sam Ruby + Carlos Antonio da Silva*
398
+ * Do not generate local variables for partials without object or collection.
399
+ Previously rendering a partial without giving `:object` or `:collection`
400
+ would generate a local variable with the partial name by default.
401
+
402
+ *Carlos Antonio da Silva*
403
+
404
+ * Return the last valid, non-private IP address from the X-Forwarded-For,
405
+ Client-IP and Remote-Addr headers, in that order. Document the rationale
406
+ for that decision, and describe the options that can be passed to the
407
+ RemoteIp middleware to change it.
408
+ Fixes #7979.
409
+
410
+ *André Arko*, *Steve Klabnik*, *Alexey Gaziev*
234
411
 
235
412
  * Do not append second slash to `root_url` when using `trailing_slash: true`
413
+ Fixes #8700.
414
+
415
+ Before:
236
416
 
237
- Fix #8700.
238
- Backport #8701.
417
+ root_url(trailing_slash: true) # => http://test.host//
239
418
 
240
- Example:
241
- # before
242
- root_url # => http://test.host//
419
+ After:
243
420
 
244
- # after
245
- root_url # => http://test.host/
421
+ root_url(trailing_slash: true) # => http://test.host/
246
422
 
247
423
  *Yves Senn*
248
424
 
249
- * Fix a bug in `content_tag_for` that prevents it for work without a block.
425
+ * Allow to toggle dumps on error pages.
426
+
427
+ *Gosha Arinich*
428
+
429
+ * Fix a bug in `content_tag_for` that prevents it from working without a block.
250
430
 
251
431
  *Jasl*
252
432
 
253
- * Clear url helper methods when routes are reloaded by removing the methods
254
- explicitly rather than just clearing the module because it didn't work
255
- properly and could be the source of a memory leak.
433
+ * Change the stylesheet of exception pages for development mode.
434
+ Additionally display also the line of code and fragment that raised
435
+ the exception in all exceptions pages.
436
+
437
+ *Guillermo Iguaran + Jorge Cuadrado*
438
+
439
+ * Do not append `charset=` parameter when `head` is called with a
440
+ `:content_type` option.
441
+ Fixes #8661.
442
+
443
+ *Yves Senn*
444
+
445
+ * Added `Mime::NullType` class. This allows to use `html?`, `xml?`, `json?`, etc.
446
+ when the format of the request is unknown, without raising an exception.
447
+
448
+ *Angelo Capilleri*
449
+
450
+ * Integrate the Journey gem into Action Dispatch so that the global namespace
451
+ is not polluted with names that may be used as models.
256
452
 
257
453
  *Andrew White*
258
454
 
455
+ * Extract support for email address obfuscation via `:encode`, `:replace_at`, and `replace_dot`
456
+ options from the `mail_to` helper into the `actionview-encoded_mail_to` gem.
457
+
458
+ *Nick Reed + DHH*
459
+
460
+ * Handle `:protocol` option in `stylesheet_link_tag` and `javascript_include_tag`
461
+
462
+ *Vasiliy Ermolovich*
463
+
464
+ * Clear url helper methods when routes are reloaded. *Andrew White*
465
+
259
466
  * Fix a bug in `ActionDispatch::Request#raw_post` that caused `env['rack.input']`
260
467
  to be read but not rewound.
261
468
 
262
469
  *Matt Venables*
263
470
 
471
+ * Prevent raising `EOFError` on multipart GET request (IE issue). *Adam Stankiewicz*
472
+
473
+ * Rename all action callbacks from *_filter to *_action to avoid the misconception that these
474
+ callbacks are only suited for transforming or halting the response. With the new style,
475
+ it's more inviting to use them as they were intended, like setting shared ivars for views.
476
+
477
+ Example:
478
+
479
+ class PeopleController < ActionController::Base
480
+ before_action :set_person, except: [:index, :new, :create]
481
+ before_action :ensure_permission, only: [:edit, :update]
482
+
483
+ ...
484
+
485
+ private
486
+ def set_person
487
+ @person = current_account.people.find(params[:id])
488
+ end
489
+
490
+ def ensure_permission
491
+ current_person.can_change?(@person)
492
+ end
493
+ end
494
+
495
+ The old *_filter methods still work with no deprecation notice.
496
+
497
+ *DHH*
498
+
499
+ * Add `cache_if` and `cache_unless` for conditional fragment caching:
500
+
501
+ Example:
502
+
503
+ <%= cache_if condition, project do %>
504
+ <b>All the topics on this project</b>
505
+ <%= render project.topics %>
506
+ <% end %>
507
+
508
+ # and
509
+
510
+ <%= cache_unless condition, project do %>
511
+ <b>All the topics on this project</b>
512
+ <%= render project.topics %>
513
+ <% end %>
514
+
515
+ *Stephen Ausman + Fabrizio Regini + Angelo Capilleri*
516
+
517
+ * Add logging filter capability for redirect URLs:
518
+
519
+ config.filter_redirect << 'http://please.hide.it/'
520
+
521
+ *Fabrizio Regini*
522
+
523
+ * Fixed a bug that ignores constraints on a glob route. This was caused because the constraint
524
+ regular expression is overwritten when the `routes.rb` file is processed. Fixes #7924
525
+
526
+ *Maura Fitzgerald*
527
+
264
528
  * More descriptive error messages when calling `render :partial` with
265
529
  an invalid `:layout` argument.
266
530
 
267
531
  Fixes #8376.
268
532
 
269
- render :partial => 'partial', :layout => true
533
+ render partial: 'partial', layout: true
534
+
270
535
  # results in ActionView::MissingTemplate: Missing partial /true
271
536
 
272
537
  *Yves Senn*
273
538
 
274
- * Accept symbols as `#send_data` :disposition value. [Backport #8329] *Elia Schito*
539
+ * Sweepers was extracted from Action Controller as `rails-observers` gem.
275
540
 
276
- * Add i18n scope to `distance_of_time_in_words`. [Backport #7997] *Steve Klabnik*
541
+ *Rafael Mendonça França*
277
542
 
278
- * Fix side effect of `url_for` changing the `:controller` string option. [Backport #6003]
279
- Before:
543
+ * Add option flag to `CacheHelper#cache` to manually bypass automatic template digests:
280
544
 
281
- controller = '/projects'
282
- url_for :controller => controller, :action => 'status'
545
+ <% cache project, skip_digest: true do %>
546
+ ...
547
+ <% end %>
283
548
 
284
- puts controller #=> 'projects'
549
+ *Drew Ulmer*
285
550
 
286
- After
551
+ * Do not sort Hash options in `grouped_options_for_select`. *Sergey Kojin*
287
552
 
288
- puts controller #=> '/projects'
553
+ * Accept symbols as `send_data :disposition` value *Elia Schito*
289
554
 
290
- *Nikita Beloglazov + Andrew White*
555
+ * Add i18n scope to `distance_of_time_in_words`. *Steve Klabnik*
291
556
 
292
- * Introduce `ActionView::Template::Handlers::ERB.escape_whitelist`. This is a list
293
- of mime types where template text is not html escaped by default. It prevents `Jack & Joe`
294
- from rendering as `Jack &amp; Joe` for the whitelisted mime types. The default whitelist
295
- contains text/plain. Fix #7976 [Backport #8235]
557
+ * `assert_template`:
558
+ - is no more passing with empty string.
559
+ - is now validating option keys. It accepts: `:layout`, `:partial`, `:locals` and `:count`.
296
560
 
297
- *Joost Baaij*
561
+ *Roberto Soares*
298
562
 
299
- * `BestStandardsSupport` middleware now appends it's `X-UA-Compatible` value to app's
300
- returned value if any. Fix #8086 [Backport #8093]
563
+ * Allow setting a symbol as path in scope on routes. This is now allowed:
301
564
 
302
- *Nikita Afanasenko*
565
+ scope :api do
566
+ resources :users
567
+ end
303
568
 
304
- * prevent double slashes in engine urls when `Rails.application.default_url_options[:trailing_slash] = true` is set
305
- Fix #7842
569
+ It is also possible to pass multiple symbols to scope to shorten multiple nested scopes:
306
570
 
307
- *Yves Senn*
571
+ scope :api do
572
+ scope :v1 do
573
+ resources :users
574
+ end
575
+ end
308
576
 
309
- * Fix input name when `:multiple => true` and `:index` are set.
577
+ can be rewritten as:
578
+
579
+ scope :api, :v1 do
580
+ resources :users
581
+ end
582
+
583
+ *Guillermo Iguaran + Amparo Luna*
584
+
585
+ * Fix error when using a non-hash query argument named "params" in `url_for`.
310
586
 
311
587
  Before:
312
588
 
313
- check_box("post", "comment_ids", { :multiple => true, :index => "foo" }, 1)
314
- #=> <input name=\"post[foo][comment_ids]\" type=\"hidden\" value=\"0\" /><input id=\"post_foo_comment_ids_1\" name=\"post[foo][comment_ids]\" type=\"checkbox\" value=\"1\" />
589
+ url_for(params: "") # => undefined method `reject!' for "":String
315
590
 
316
591
  After:
317
592
 
318
- check_box("post", "comment_ids", { :multiple => true, :index => "foo" }, 1)
319
- #=> <input name=\"post[foo][comment_ids][]\" type=\"hidden\" value=\"0\" /><input id=\"post_foo_comment_ids_1\" name=\"post[foo][comment_ids][]\" type=\"checkbox\" value=\"1\" />
593
+ url_for(params: "") # => http://www.example.com?params=
320
594
 
321
- Fix #8108
595
+ *tumayun + Carlos Antonio da Silva*
322
596
 
323
- *Daniel Fox, Grant Hutchins & Trace Wax*
597
+ * Render every partial with a new `ActionView::PartialRenderer`. This resolves
598
+ issues when rendering nested partials.
599
+ Fixes #8197.
324
600
 
601
+ *Yves Senn*
325
602
 
326
- ## Rails 3.2.12 (Feb 11, 2013) ##
603
+ * Introduce `ActionView::Template::Handlers::ERB.escape_whitelist`. This is a list
604
+ of mime types where template text is not html escaped by default. It prevents `Jack & Joe`
605
+ from rendering as `Jack &amp; Joe` for the whitelisted mime types. The default whitelist
606
+ contains `text/plain`.
607
+ Fixes #7976.
327
608
 
328
- * No changes.
609
+ *Joost Baaij*
329
610
 
611
+ * Fix input name when `multiple: true` and `:index` are set.
330
612
 
331
- ## Rails 3.2.11 (Jan 8, 2013) ##
613
+ Before:
332
614
 
333
- * Strip nils from collections on JSON and XML posts. [CVE-2013-0155]
615
+ check_box("post", "comment_ids", { multiple: true, index: "foo" }, 1)
616
+ # => <input name=\"post[foo][comment_ids]\" type=\"hidden\" value=\"0\" /><input id=\"post_foo_comment_ids_1\" name=\"post[foo][comment_ids]\" type=\"checkbox\" value=\"1\" />
334
617
 
618
+ After:
335
619
 
336
- ## Rails 3.2.10 (Jan 2, 2013) ##
620
+ check_box("post", "comment_ids", { multiple: true, index: "foo" }, 1)
621
+ # => <input name=\"post[foo][comment_ids][]\" type=\"hidden\" value=\"0\" /><input id=\"post_foo_comment_ids_1\" name=\"post[foo][comment_ids][]\" type=\"checkbox\" value=\"1\" />
337
622
 
338
- * No changes.
623
+ Fixes #8108.
339
624
 
625
+ *Daniel Fox, Grant Hutchins & Trace Wax*
340
626
 
341
- ## Rails 3.2.9 (Nov 12, 2012) ##
627
+ * `date_select` helper accepts `with_css_classes: true` to add css classes similar with type
628
+ of generated select tags.
342
629
 
343
- * Clear url helpers when reloading routes.
630
+ *Pavel Nikitin*
344
631
 
345
- *Santiago Pastorino*
632
+ * Only non-js/css under `app/assets` path will be included in default `config.assets.precompile`.
346
633
 
347
- * Revert the shorthand routes scoped with `:module` option fix
348
- This added a regression since it is changing the URL mapping.
349
- This makes the stable release backward compatible.
634
+ *Josh Peek*
350
635
 
351
- *Rafael Mendonça França*
636
+ * Remove support for the `RAILS_ASSET_ID` environment configuration
637
+ (no longer needed now that we have the asset pipeline).
352
638
 
353
- * Revert the `assert_template` fix to not pass with ever string that matches the template name.
354
- This added a regression since people were relying on this buggy behavior.
355
- This will introduce back #3849 but this stable release will be backward compatible.
356
- Fixes #8068.
639
+ *Josh Peek*
357
640
 
358
- *Rafael Mendonça França*
641
+ * Remove old `asset_path` configuration (no longer needed now that we have the asset pipeline).
359
642
 
360
- * Revert the rename of internal variable on ActionController::TemplateAssertions to prevent
361
- naming collisions. This added a regression related with shoulda-matchers, since it is
362
- expecting the [instance variable @layouts](https://github.com/thoughtbot/shoulda-matchers/blob/9e1188eea68c47d9a56ce6280e45027da6187ab1/lib/shoulda/matchers/action_controller/render_with_layout_matcher.rb#L74).
363
- This will introduce back #7459 but this stable release will be backward compatible.
364
- Fixes #8068.
643
+ *Josh Peek*
365
644
 
366
- *Rafael Mendonça França*
645
+ * `assert_template` can be used to assert on the same template with different locals
646
+ Fixes #3675.
647
+
648
+ *Yves Senn*
649
+
650
+ * Remove old asset tag concatenation (no longer needed now that we have the asset pipeline).
367
651
 
368
- * Accept :remote as symbolic option for `link_to` helper. *Riley Lynch*
652
+ *Josh Peek*
653
+
654
+ * Accept `:remote` as symbolic option for `link_to` helper. *Riley Lynch*
369
655
 
370
656
  * Warn when the `:locals` option is passed to `assert_template` outside of a view test case
371
- Fix #3415
657
+ Fixes #3415.
372
658
 
373
659
  *Yves Senn*
374
660
 
375
- * Rename internal variables on ActionController::TemplateAssertions to prevent
376
- naming collisions. @partials, @templates and @layouts are now prefixed with an underscore.
377
- Fix #7459
661
+ * The `Rack::Cache` middleware is now disabled by default. To enable it,
662
+ set `config.action_dispatch.rack_cache = true` and add `gem rack-cache` to your Gemfile.
663
+
664
+ *Guillermo Iguaran*
665
+
666
+ * `ActionController::Base.page_cache_extension` option is deprecated
667
+ in favour of `ActionController::Base.default_static_extension`.
668
+
669
+ *Francesco Rodriguez*
670
+
671
+ * Action and Page caching has been extracted from Action Dispatch
672
+ as `actionpack-action_caching` and `actionpack-page_caching` gems.
673
+ Please read the `README.md` file on both gems for the usage.
674
+
675
+ *Francesco Rodriguez*
676
+
677
+ * Failsafe exception returns `text/plain`. *Steve Klabnik*
678
+
679
+ * Rename internal variables on `ActionController::TemplateAssertions` to prevent
680
+ naming collisions. `@partials`, `@templates` and `@layouts` are now prefixed with an underscore.
681
+ Fixes #7459.
378
682
 
379
683
  *Yves Senn*
380
684
 
381
- * `resource` and `resources` don't modify the passed options hash
382
- Fix #7777
685
+ * `resource` and `resources` don't modify the passed options hash.
686
+ Fixes #7777.
383
687
 
384
688
  *Yves Senn*
385
689
 
386
- * Precompiled assets include aliases from foo.js to foo/index.js and vice versa.
690
+ * Precompiled assets include aliases from `foo.js` to `foo/index.js` and vice versa.
387
691
 
388
692
  # Precompiles phone-<digest>.css and aliases phone/index.css to phone.css.
389
693
  config.assets.precompile = [ 'phone.css' ]
@@ -416,366 +720,511 @@
416
720
 
417
721
  *Hugolnx*
418
722
 
419
- * Handle `ActionDispatch::Http::UploadedFile` like `Rack::Test::UploadedFile`, don't call to_param on it. Since
420
- `Rack::Test::UploadedFile` isn't API compatible this is needed to test file uploads that rely on `tempfile`
421
- being available.
723
+ * `image_tag` will set the same width and height for image if numerical value
724
+ passed to `size` option.
725
+
726
+ *Nihad Abbasov*
727
+
728
+ * Deprecate `Mime::Type#verify_request?` and `Mime::Type.browser_generated_types`,
729
+ since they are no longer used inside of Rails, they will be removed in Rails 4.1.
422
730
 
423
- *Tim Vandecasteele*
731
+ *Michael Grosser*
424
732
 
425
- * Respect `config.digest = false` for `asset_path`
733
+ * `ActionDispatch::Http::UploadedFile` now delegates `close` to its tempfile. *Sergio Gil*
426
734
 
427
- Previously, the `asset_path` internals only respected the `:digest`
428
- option, but ignored the global config setting. This meant that
429
- `config.digest = false` could not be used in conjunction with
430
- `config.compile = false` this corrects the behavior.
735
+ * Add `ActionController::StrongParameters`, this module converts `params` hash into
736
+ an instance of ActionController::Parameters that allows whitelisting of permitted
737
+ parameters. Non-permitted parameters are forbidden to be used in Active Model by default
738
+ For more details check the documentation of the module or the
739
+ [strong_parameters gem](https://github.com/rails/strong_parameters)
431
740
 
432
- *Peter Wagenet*
741
+ *DHH + Guillermo Iguaran*
433
742
 
434
- * Fix #7646, the log now displays the correct status code when an exception is raised.
743
+ * Remove Integration between `attr_accessible`/`attr_protected` and
744
+ `ActionController::ParamsWrapper`. ParamWrapper now wraps all the parameters returned
745
+ by the class method `attribute_names`.
746
+
747
+ *Guillermo Iguaran*
748
+
749
+ * Log now displays the correct status code when an exception is raised.
750
+ Fixes #7646.
435
751
 
436
752
  *Yves Senn*
437
753
 
438
- * Fix handling of date selects when using both disabled and discard options.
439
- Fixes #7431.
754
+ * Allow pass couple extensions to `ActionView::Template.register_template_handler` call.
440
755
 
441
- *Vasiliy Ermolovich*
756
+ *Tima Maslyuchenko*
442
757
 
443
- * Fix select_tag when option_tags is nil.
444
- Fixes #7404.
758
+ * Sprockets integration has been extracted from Action Pack to the `sprockets-rails`
759
+ gem. `rails` gem is depending on `sprockets-rails` by default.
445
760
 
446
- *Sandeep Ravichandran*
761
+ *Guillermo Iguaran*
447
762
 
448
- * `javascript_include_tag :all` will now not include `application.js` if the file does not exists. *Prem Sichanugrist*
763
+ * `ActionDispatch::Session::MemCacheStore` now uses `dalli` instead of the deprecated
764
+ `memcache-client` gem.
449
765
 
450
- * Support cookie jar options (e.g., domain :all) for all session stores.
451
- Fixes GH#3047, GH#2483.
766
+ *Arun Agrawal + Guillermo Iguaran*
452
767
 
453
- *Ravil Bayramgalin*
768
+ * Support multiple etags in If-None-Match header. *Travis Warlick*
454
769
 
455
- * Performance Improvement to send_file: Avoid having to pass an open file handle as the response body. Rack::Sendfile
456
- will usually intercept the response and just uses the path directly, so no reason to open the file. This performance
457
- improvement also resolves an issue with jRuby encodings, and is the reason for the backport, see issue #6844.
770
+ * Allow to configure how unverified request will be handled using `:with`
771
+ option in `protect_from_forgery` method.
458
772
 
459
- *Jeremy Kemper & Erich Menge*
773
+ Valid unverified request handling methods are:
460
774
 
775
+ - `:exception` - Raises ActionController::InvalidAuthenticityToken exception.
776
+ - `:reset_session` - Resets the session.
777
+ - `:null_session` - Provides an empty session during request but doesn't
778
+ reset it completely. Used as default if `:with` option is not specified.
461
779
 
462
- ## Rails 3.2.8 (Aug 9, 2012) ##
780
+ New applications are generated with:
463
781
 
464
- * There is an XSS vulnerability in the strip_tags helper in Ruby on Rails, the
465
- helper doesn't correctly handle malformed html. As a result an attacker can
466
- execute arbitrary javascript through the use of specially crafted malformed
467
- html.
782
+ protect_from_forgery with: :exception
468
783
 
469
- *Marek from Nethemba (www.nethemba.com) & Santiago Pastorino*
784
+ *Sergey Nartimov*
470
785
 
471
- * When a "prompt" value is supplied to the `select_tag` helper, the "prompt" value is not escaped.
472
- If untrusted data is not escaped, and is supplied as the prompt value, there is a potential for XSS attacks.
473
- Vulnerable code will look something like this:
474
- select_tag("name", options, :prompt => UNTRUSTED_INPUT)
786
+ * Add `.ruby` template handler, this handler simply allows arbitrary Ruby code as a template. *Guillermo Iguaran*
475
787
 
476
- *Santiago Pastorino*
788
+ * Add `separator` option for `ActionView::Helpers::TextHelper#excerpt`:
477
789
 
478
- * Reverted the deprecation of `:confirm`. *Rafael Mendonça França*
790
+ excerpt('This is a very beautiful morning', 'very', separator: ' ', radius: 1)
791
+ # => ...a very beautiful...
479
792
 
480
- * Reverted the deprecation of `:disable_with`. *Rafael Mendonça França*
793
+ *Guirec Corbel*
481
794
 
482
- * Reverted the deprecation of `:mouseover` option to `image_tag`. *Rafael Mendonça França*
795
+ * Added controller-level etag additions that will be part of the action etag computation *Jeremy Kemper/DHH*
483
796
 
484
- * Reverted the deprecation of `button_to_function` and `link_to_function` helpers.
797
+ class InvoicesController < ApplicationController
798
+ etag { current_user.try :id }
485
799
 
486
- *Rafael Mendonça França*
800
+ def show
801
+ # Etag will differ even for the same invoice when it's viewed by a different current_user
802
+ @invoice = Invoice.find(params[:id])
803
+ fresh_when(@invoice)
804
+ end
805
+ end
487
806
 
807
+ * Add automatic template digests to all `CacheHelper#cache` calls (originally spiked in the `cache_digests` plugin) *DHH*
488
808
 
489
- ## Rails 3.2.7 (Jul 26, 2012) ##
809
+ * When building a URL fails, add missing keys provided by Journey. Failed URL
810
+ generation now returns a 500 status instead of a 404.
490
811
 
491
- * Do not convert digest auth strings to symbols. CVE-2012-3424
812
+ *Richard Schneeman*
492
813
 
493
- * Bump Journey requirements to 1.0.4
814
+ * Deprecate availability of `ActionView::RecordIdentifier` in controllers by default.
815
+ It's view specific and can be easily included in controllers manually if someone
816
+ really needs it. Also deprecate calling `ActionController::RecordIdentifier.dom_id` and
817
+ `dom_class` directly, in favor of `ActionView::RecordIdentifier.dom_id` and `dom_class`.
818
+ `RecordIdentifier` will be removed from `ActionController::Base` in Rails 4.1.
494
819
 
495
- * Add support for optional root segments containing slashes
820
+ *Piotr Sarnacki*
496
821
 
497
- * Fixed bug creating invalid HTML in select options
822
+ * Fix `ActionView::RecordIdentifier` to work as a singleton. *Piotr Sarnacki*
498
823
 
499
- * Show in log correct wrapped keys
824
+ * Deprecate `Template#mime_type`, it will be removed in Rails 4.1 in favor of `#type`.
825
+ *Piotr Sarnacki*
500
826
 
501
- * Fix NumberHelper options wrapping to prevent verbatim blocks being rendered instead of line continuations.
827
+ * Move vendored html-scanner from `action_controller` to `action_view` directory. If you
828
+ require it directly, please use 'action_view/vendor/html-scanner', reference to
829
+ 'action_controller/vendor/html-scanner' will be removed in Rails 4.1. *Piot Sarnacki*
502
830
 
503
- * ActionController::Metal doesn't have logger method, check it and then delegate
831
+ * Fix handling of date selects when using both disabled and discard options.
832
+ Fixes #7431.
504
833
 
505
- * ActionController::Caching depends on RackDelegation and AbstractController::Callbacks
834
+ *Vasiliy Ermolovich*
506
835
 
836
+ * `ActiveRecord::SessionStore` is extracted out of Rails into a gem `activerecord-session_store`.
837
+ Setting `config.session_store` to `:active_record_store` will no longer work and will break
838
+ if the `activerecord-session_store` gem isn't available. *Prem Sichanugrist*
507
839
 
508
- ## Rails 3.2.6 (Jun 12, 2012) ##
840
+ * Fix `select_tag` when `option_tags` is nil.
841
+ Fixes #7404.
509
842
 
510
- * nil is removed from array parameter values
843
+ *Sandeep Ravichandran*
511
844
 
512
- CVE-2012-2694
845
+ * Add `Request#formats=(extensions)` that lets you set multiple formats directly in a prioritized order.
513
846
 
514
- * Deprecate `:confirm` in favor of `':data => { :confirm => "Text" }'` option for `button_to`, `button_tag`, `image_submit_tag`, `link_to` and `submit_tag` helpers.
847
+ Example of using this for custom iphone views with an HTML fallback:
515
848
 
516
- *Carlos Galdino*
849
+ class ApplicationController < ActionController::Base
850
+ before_filter :adjust_format_for_iphone_with_html_fallback
517
851
 
518
- * Allow to use mounted_helpers (helpers for accessing mounted engines) in ActionView::TestCase. *Piotr Sarnacki*
852
+ private
853
+ def adjust_format_for_iphone_with_html_fallback
854
+ request.formats = [ :iphone, :html ] if request.env["HTTP_USER_AGENT"][/iPhone/]
855
+ end
856
+ end
519
857
 
520
- * Include mounted_helpers (helpers for accessing mounted engines) in ActionDispatch::IntegrationTest by default. *Piotr Sarnacki*
858
+ *DHH*
521
859
 
860
+ * Add Routing Concerns to declare common routes that can be reused inside
861
+ others resources and routes.
522
862
 
523
- ## Rails 3.2.5 (Jun 1, 2012) ##
863
+ Code before:
524
864
 
525
- * No changes.
865
+ resources :messages do
866
+ resources :comments
867
+ end
526
868
 
869
+ resources :posts do
870
+ resources :comments
871
+ resources :images, only: :index
872
+ end
527
873
 
528
- ## Rails 3.2.4 (May 31, 2012) ##
874
+ Code after:
529
875
 
530
- * Deprecate old APIs for highlight, excerpt and word_wrap *Jeremy Walker*
876
+ concern :commentable do
877
+ resources :comments
878
+ end
531
879
 
532
- * Deprecate `:disable_with` in favor of `'data-disable-with'` option for `button_to`, `button_tag` and `submit_tag` helpers.
880
+ concern :image_attachable do
881
+ resources :images, only: :index
882
+ end
533
883
 
534
- *Carlos Galdino + Rafael Mendonça França*
884
+ resources :messages, concerns: :commentable
535
885
 
536
- * Deprecate `:mouseover` option for `image_tag` helper. *Rafael Mendonça França*
886
+ resources :posts, concerns: [:commentable, :image_attachable]
537
887
 
538
- * Deprecate `button_to_function` and `link_to_function` helpers. *Rafael Mendonça França*
888
+ *DHH + Rafael Mendonça França*
539
889
 
540
- * Don't break Haml with textarea newline fix. GH #393, #4000, #5190, #5191
890
+ * Add `start_hour` and `end_hour` options to the `select_hour` helper. *Evan Tann*
541
891
 
542
- * Fix options handling on labels. GH #2492, #5614
892
+ * Raises an `ArgumentError` when the first argument in `form_for` contain `nil`
893
+ or is empty.
543
894
 
544
- * Added config.action_view.embed_authenticity_token_in_remote_forms to deal
545
- with regression from 16ee611fa
895
+ *Richard Schneeman*
546
896
 
547
- * Set rendered_format when doing render :inline. GH #5632
897
+ * Add 'X-Frame-Options' => 'SAMEORIGIN'
898
+ 'X-XSS-Protection' => '1; mode=block' and
899
+ 'X-Content-Type-Options' => 'nosniff'
900
+ as default headers.
548
901
 
549
- * Fix the redirect when it receive blocks with arity of 1. Closes #5677
902
+ *Egor Homakov*
550
903
 
551
- * Strip [nil] from parameters hash. Thanks to Ben Murphy for
552
- reporting this! CVE-2012-2660
904
+ * Allow data attributes to be set as a first-level option for `form_for`, so you can write `form_for @record, data: { behavior: 'autosave' }` instead of `form_for @record, html: { data: { behavior: 'autosave' } }` *DHH*
553
905
 
906
+ * Deprecate `button_to_function` and `link_to_function` helpers.
554
907
 
555
- ## Rails 3.2.3 (March 30, 2012) ##
908
+ We recommend the use of Unobtrusive JavaScript instead. For example:
556
909
 
557
- * Allow to lazy load `default_form_builder` by passing a `String` instead of a constant. *Piotr Sarnacki*
910
+ link_to "Greeting", "#", class: "nav_link"
558
911
 
559
- * Fix #5632, render :inline set the proper rendered format. *Santiago Pastorino*
912
+ $(function() {
913
+ $('.nav_link').click(function() {
914
+ // Some complex code
560
915
 
561
- * Fix textarea rendering when using plugins like HAML. Such plugins encode the first newline character in the content. This issue was introduced in https://github.com/rails/rails/pull/5191 *James Coleman*
916
+ return false;
917
+ });
918
+ });
562
919
 
563
- * Remove the leading \n added by textarea on assert_select. *Santiago Pastorino*
920
+ or
564
921
 
565
- * Add `config.action_view.embed_authenticity_token_in_remote_forms` (defaults to true) which allows to set if authenticity token will be included by default in remote forms. If you change it to false, you can still force authenticity token by passing `:authenticity_token => true` in form options *Piotr Sarnacki*
922
+ link_to "Greeting", '#', onclick: "alert('Hello world!'); return false", class: "nav_link"
566
923
 
567
- * Do not include the authenticity token in forms where remote: true as ajax forms use the meta-tag value *DHH*
924
+ for simple cases.
568
925
 
569
- * Turn off verbose mode of rack-cache, we still have X-Rack-Cache to
570
- check that info. Closes #5245. *Santiago Pastorino*
926
+ *Rafael Mendonça França*
571
927
 
572
- * Fix #5238, rendered_format is not set when template is not rendered. *Piotr Sarnacki*
928
+ * `javascript_include_tag :all` will now not include `application.js` if the file does not exists. *Prem Sichanugrist*
573
929
 
574
- * Upgrade rack-cache to 1.2. *José Valim*
930
+ * Send an empty response body when call `head` with status between 100 and 199, 204, 205 or 304.
575
931
 
576
- * ActionController::SessionManagement is deprecated. *Santiago Pastorino*
932
+ *Armand du Plessis*
577
933
 
578
- * Since the router holds references to many parts of the system like engines, controllers and the application itself, inspecting the route set can actually be really slow, therefore we default alias inspect to to_s. *José Valim*
934
+ * Fixed issue with where digest authentication would not work behind a proxy. *Arthur Smith*
579
935
 
580
- * Add a new line after the textarea opening tag. Closes #393 *Rafael Mendonça França*
936
+ * Added `ActionController::Live`. Mix it in to your controller and you can
937
+ stream data to the client live. For example:
581
938
 
582
- * Always pass a respond block from to responder. We should let the responder to decide what to do with the given overridden response block, and not short circuit it. *sikachu*
939
+ class FooController < ActionController::Base
940
+ include ActionController::Live
583
941
 
584
- * Fixes layout rendering regression from 3.2.2. *José Valim*
942
+ def index
943
+ 100.times {
944
+ # Client will see this as it's written
945
+ response.stream.write "hello world\n"
946
+ sleep 1
947
+ }
948
+ response.stream.close
949
+ end
950
+ end
585
951
 
952
+ *Aaron Patterson*
586
953
 
587
- ## Rails 3.2.2 (March 1, 2012) ##
954
+ * Remove `ActionDispatch::Head` middleware in favor of `Rack::Head`. *Santiago Pastorino*
588
955
 
589
- * Format lookup for partials is derived from the format in which the template is being rendered. Closes #5025 part 2 *Santiago Pastorino*
956
+ * Deprecate `:confirm` in favor of `data: { confirm: "Text" }` option for `button_to`, `button_tag`, `image_submit_tag`, `link_to` and `submit_tag` helpers.
590
957
 
591
- * Use the right format when a partial is missing. Closes #5025. *Santiago Pastorino*
958
+ *Carlos Galdino + Rafael Mendonça França*
592
959
 
593
- * Default responder will now always use your overridden block in `respond_with` to render your response. *Prem Sichanugrist*
960
+ * Show routes in exception page while debugging a `RoutingError` in development.
594
961
 
595
- * check_box helper with :disabled => true will generate a disabled hidden field to conform with the HTML convention where disabled fields are not submitted with the form.
596
- This is a behavior change, previously the hidden tag had a value of the disabled checkbox.
597
- *Tadas Tamosauskas*
962
+ *Richard Schneeman + Mattt Thompson + Yves Senn*
598
963
 
964
+ * Add `ActionController::Flash.add_flash_types` method to allow people to register their own flash types. e.g.:
599
965
 
600
- ## Rails 3.2.1 (January 26, 2012) ##
966
+ class ApplicationController
967
+ add_flash_types :error, :warning
968
+ end
601
969
 
602
- * Documentation improvements.
970
+ If you add the above code, you can use `<%= error %>` in an erb, and `redirect_to /foo, error: 'message'` in a controller.
603
971
 
604
- * Allow `form.select` to accept ranges (regression). *Jeremy Walker*
972
+ *kennyj*
605
973
 
606
- * `datetime_select` works with -/+ infinity dates. *Joe Van Dyk*
974
+ * Remove Active Model dependency from Action Pack. *Guillermo Iguaran*
607
975
 
976
+ * Support unicode characters in routes. Route will be automatically escaped, so instead of manually escaping:
608
977
 
609
- ## Rails 3.2.0 (January 20, 2012) ##
978
+ get Rack::Utils.escape('こんにちは') => 'home#index'
610
979
 
611
- * Setting config.assets.logger to false turn off Sprockets logger *Guillermo Iguaran*
980
+ You just have to write the unicode route:
612
981
 
613
- * Add `config.action_dispatch.default_charset` to configure default charset for ActionDispatch::Response. *Carlos Antonio da Silva*
982
+ get 'こんにちは' => 'home#index'
614
983
 
615
- * Deprecate setting default charset at controller level, use the new `config.action_dispatch.default_charset` instead. *Carlos Antonio da Silva*
984
+ *kennyj*
616
985
 
617
- * Deprecate ActionController::UnknownAction in favour of AbstractController::ActionNotFound. *Carlos Antonio da Silva*
986
+ * Return proper format on exceptions. *Santiago Pastorino*
618
987
 
619
- * Deprecate ActionController::DoubleRenderError in favour of AbstractController::DoubleRenderError. *Carlos Antonio da Silva*
988
+ * Allow to use `mounted_helpers` (helpers for accessing mounted engines) in `ActionView::TestCase`. *Piotr Sarnacki*
620
989
 
621
- * Deprecate method_missing handling for not found actions, use action_missing instead. *Carlos Antonio da Silva*
990
+ * Include `mounted_helpers` (helpers for accessing mounted engines) in `ActionDispatch::IntegrationTest` by default. *Piotr Sarnacki*
622
991
 
623
- * Deprecate ActionController#rescue_action, ActionController#initialize_template_class, and ActionController#assign_shortcuts.
624
- These methods were not being used internally anymore and are going to be removed in Rails 4. *Carlos Antonio da Silva*
992
+ * Extracted redirect logic from `ActionController::ForceSSL::ClassMethods.force_ssl` into `ActionController::ForceSSL#force_ssl_redirect`
625
993
 
626
- * Add config.assets.logger to configure Sprockets logger *Rafael França*
994
+ *Jeremy Friesen*
627
995
 
628
- * Use a BodyProxy instead of including a Module that responds to
629
- close. Closes #4441 if Active Record is disabled assets are delivered
630
- correctly *Santiago Pastorino*
996
+ * Make possible to use a block in `button_to` if the button text is hard
997
+ to fit into the name parameter, e.g.:
631
998
 
632
- * Rails initialization with initialize_on_precompile = false should set assets_dir *Santiago Pastorino*
999
+ <%= button_to [:make_happy, @user] do %>
1000
+ Make happy <strong><%= @user.name %></strong>
1001
+ <% end %>
1002
+ # => "<form method="post" action="/users/1/make_happy" class="button_to">
1003
+ # <div>
1004
+ # <button type="submit">
1005
+ # Make happy <strong>Name</strong>
1006
+ # </button>
1007
+ # </div>
1008
+ # </form>"
633
1009
 
634
- * Add font_path helper method *Santiago Pastorino*
1010
+ *Sergey Nartimov*
635
1011
 
636
- * Depends on rack ~> 1.4.0 *Santiago Pastorino*
1012
+ * Change a way of ordering helpers from several directories. Previously,
1013
+ when loading helpers from multiple paths, all of the helpers files were
1014
+ gathered into one array an then they were sorted. Helpers from different
1015
+ directories should not be mixed before loading them to make loading more
1016
+ predictable. The most common use case for such behavior is loading helpers
1017
+ from engines. When you load helpers from application and engine Foo, in
1018
+ that order, first rails will load all of the helpers from application,
1019
+ sorted alphabetically and then it will do the same for Foo engine.
637
1020
 
638
- * Add :gzip option to `caches_page`. The default option can be configured globally using `page_cache_compression` *Andrey Sitnik*
1021
+ *Piotr Sarnacki*
639
1022
 
640
- * The ShowExceptions middleware now accepts a exceptions application that is responsible to render an exception when the application fails. The application is invoked with a copy of the exception in `env["action_dispatch.exception"]` and with the PATH_INFO rewritten to the status code. *José Valim*
1023
+ * `truncate` now always returns an escaped HTML-safe string. The option `:escape` can be used as
1024
+ false to not escape the result.
641
1025
 
642
- * Add `button_tag` support to ActionView::Helpers::FormBuilder.
1026
+ *Li Ellis Gallardo + Rafael Mendonça França*
643
1027
 
644
- This support mimics the default behavior of `submit_tag`.
1028
+ * `truncate` now accepts a block to show extra content when the text is truncated. *Li Ellis Gallardo*
645
1029
 
646
- Example:
1030
+ * Add `week_field`, `week_field_tag`, `month_field`, `month_field_tag`, `datetime_local_field`,
1031
+ `datetime_local_field_tag`, `datetime_field` and `datetime_field_tag` helpers. *Carlos Galdino*
647
1032
 
648
- <%= form_for @post do |f| %>
649
- <%= f.button %>
650
- <% end %>
1033
+ * Add `color_field` and `color_field_tag` helpers. *Carlos Galdino*
651
1034
 
652
- * Date helpers accept a new option, `:use_two_digit_numbers = true`, that renders select boxes for months and days with a leading zero without changing the respective values.
653
- For example, this is useful for displaying ISO8601-style dates such as '2011-08-01'. *Lennart Fridén and Kim Persson*
1035
+ * `assert_generates`, `assert_recognizes`, and `assert_routing` all raise
1036
+ `Assertion` instead of `RoutingError` *David Chelimsky*
654
1037
 
655
- * Make ActiveSupport::Benchmarkable a default module for ActionController::Base, so the #benchmark method is once again available in the controller context like it used to be *DHH*
1038
+ * URL path parameters with invalid encoding now raise `ActionController::BadRequest`. *Andrew White*
656
1039
 
657
- * Deprecated implied layout lookup in controllers whose parent had a explicit layout set:
1040
+ * Malformed query and request parameter hashes now raise `ActionController::BadRequest`. *Andrew White*
658
1041
 
659
- class ApplicationController
660
- layout "application"
661
- end
1042
+ * Add `divider` option to `grouped_options_for_select` to generate a separator
1043
+ `optgroup` automatically, and deprecate `prompt` as third argument, in favor
1044
+ of using an options hash. *Nicholas Greenfield*
662
1045
 
663
- class PostsController < ApplicationController
664
- end
1046
+ * Add `time_field` and `time_field_tag` helpers which render an `input[type="time"]` tag. *Alex Soulim*
665
1047
 
666
- In the example above, Posts controller will no longer automatically look up for a posts layout.
1048
+ * Removed old text helper apis from `highlight`, `excerpt` and `word_wrap`. *Jeremy Walker*
667
1049
 
668
- If you need this functionality you could either remove `layout "application"` from ApplicationController or explicitly set it to nil in PostsController. *José Valim*
1050
+ * Templates without a handler extension now raises a deprecation warning but still
1051
+ defaults to ERB. In future releases, it will simply return the template contents. *Steve Klabnik*
669
1052
 
670
- * Rails will now use your default layout (such as "layouts/application") when you specify a layout with `:only` and `:except` condition, and those conditions fail. *Prem Sichanugrist*
1053
+ * Deprecate `:disable_with` in favor of `data: { disable_with: "Text" }` option from `submit_tag`, `button_tag` and `button_to` helpers.
671
1054
 
672
- For example, consider this snippet:
1055
+ *Carlos Galdino + Rafael Mendonça França*
673
1056
 
674
- class CarsController
675
- layout 'single_car', :only => :show
676
- end
1057
+ * Remove `:mouseover` option from `image_tag` helper. *Rafael Mendonça França*
677
1058
 
678
- Rails will use 'layouts/single_car' when a request comes in `:show` action, and use 'layouts/application' (or 'layouts/cars', if exists) when a request comes in for any other actions.
1059
+ * The `select` method (select tag) forces `:include_blank` if `required` is true and
1060
+ `display size` is one and `multiple` is not true. *Angelo Capilleri*
679
1061
 
680
- * form_for with +:as+ option uses "#{action}_#{as}" as css class and id:
1062
+ * Copy literal route constraints to defaults so that url generation know about them.
1063
+ The copied constraints are `:protocol`, `:subdomain`, `:domain`, `:host` and `:port`.
681
1064
 
682
- Before:
1065
+ *Andrew White*
683
1066
 
684
- form_for(@user, :as => 'client') # => "<form class="client_new">..."
1067
+ * `respond_to` and `respond_with` now raise `ActionController::UnknownFormat` instead
1068
+ of directly returning head 406. The exception is rescued and converted to 406
1069
+ in the exception handling middleware. *Steven Soroka*
685
1070
 
686
- Now:
1071
+ * Allows `assert_redirected_to` to match against a regular expression. *Andy Lindeman*
687
1072
 
688
- form_for(@user, :as => 'client') # => "<form class="new_client">..."
1073
+ * Add backtrace to development routing error page. *Richard Schneeman*
689
1074
 
690
- *Vasiliy Ermolovich*
1075
+ * Replace `include_seconds` boolean argument with `include_seconds: true` option
1076
+ in `distance_of_time_in_words` and `time_ago_in_words` signature. *Dmitriy Kiriyenko*
691
1077
 
692
- * Allow rescue responses to be configured through a railtie as in `config.action_dispatch.rescue_responses`. Please look at ActiveRecord::Railtie for an example *José Valim*
1078
+ * Make current object and counter (when it applies) variables accessible when
1079
+ rendering templates with :object / :collection. *Carlos Antonio da Silva*
693
1080
 
694
- * Allow fresh_when/stale? to take a record instead of an options hash *DHH*
1081
+ * JSONP now uses mimetype `text/javascript` instead of `application/json`. *omjokine*
695
1082
 
696
- * Assets should use the request protocol by default or default to relative if no request is available *Jonathan del Strother*
1083
+ * Allow to lazy load `default_form_builder` by passing a `String` instead of a constant. *Piotr Sarnacki*
697
1084
 
698
- * Log "Filter chain halted as CALLBACKNAME rendered or redirected" every time a before callback halts *José Valim*
1085
+ * Session arguments passed to `process` calls in functional tests are now merged into
1086
+ the existing session, whereas previously they would replace the existing session.
1087
+ This change may break some existing tests if they are asserting the exact contents of
1088
+ the session but should not break existing tests that only assert individual keys.
699
1089
 
700
- * You can provide a namespace for your form to ensure uniqueness of id attributes on form elements.
701
- The namespace attribute will be prefixed with underscore on the generate HTML id. *Vasiliy Ermolovich*
1090
+ *Andrew White*
702
1091
 
703
- Example:
1092
+ * In the routes DSL the `:via` option of `match` is now mandatory.
704
1093
 
705
- <%= form_for(@offer, :namespace => 'namespace') do |f| %>
706
- <%= f.label :version, 'Version' %>:
707
- <%= f.text_field :version %>
708
- <% end %>
1094
+ For routes that respond to one single verb it is recommended to use the more specific
1095
+ macros `get`, `post`, etc. instead. You can still map all HTTP verbs to one action
1096
+ with `match`, but it has to be explictly configured using `:via => :all`.
1097
+
1098
+ *José Valim and Yehuda Katz*
709
1099
 
710
- * Refactor ActionDispatch::ShowExceptions. The controller is responsible for choosing to show exceptions when `consider_all_requests_local` is false.
1100
+ * Add `index` method to FormBuilder class. *Jorge Bejar*
711
1101
 
712
- It's possible to override `show_detailed_exceptions?` in controllers to specify which requests should provide debugging information on errors. The default value is now false, meaning local requests in production will no longer show the detailed exceptions page unless `show_detailed_exceptions?` is overridden and set to `request.local?`.
1102
+ * Remove the leading \n added by textarea on `assert_select`. *Santiago Pastorino*
713
1103
 
714
- * Responders now return 204 No Content for API requests without a response body (as in the new scaffold) *José Valim*
1104
+ * Changed default value for `config.action_view.embed_authenticity_token_in_remote_forms`
1105
+ to `false`. This change breaks remote forms that need to work also without JavaScript,
1106
+ so if you need such behavior, you can either set it to `true` or explicitly pass
1107
+ `authenticity_token: true` in form options.
715
1108
 
716
- * Added ActionDispatch::RequestId middleware that'll make a unique X-Request-Id header available to the response and enables the ActionDispatch::Request#uuid method. This makes it easy to trace requests from end-to-end in the stack and to identify individual requests in mixed logs like Syslog *DHH*
1109
+ * Added `ActionDispatch::SSL` middleware that when included force all the requests to be under HTTPS protocol. *Rafael Mendonça França*
717
1110
 
718
- * Limit the number of options for select_year to 1000.
1111
+ * Add `include_hidden` option to select tag. With `include_hidden: false` select with `multiple` attribute doesn't generate hidden input with blank value. *Vasiliy Ermolovich*
719
1112
 
720
- Pass the :max_years_allowed option to set your own limit.
1113
+ * Removed default `size` option from the `text_field`, `search_field`, `telephone_field`, `url_field`, `email_field` helpers. *Philip Arndt*
721
1114
 
722
- *Libo Cannici*
1115
+ * Removed default `cols` and `rows` options from the `text_area` helper. *Philip Arndt*
723
1116
 
724
- * Passing formats or handlers to render :template and friends is deprecated. For example: *Nick Sutterer & José Valim*
1117
+ * Adds support for layouts when rendering a partial with a given collection. *serabe*
725
1118
 
726
- render :template => "foo.html.erb"
1119
+ * Allows the route helper `root` to take a string argument. For example, `root 'pages#main'`. *bcardarella*
727
1120
 
728
- Instead, you can provide :handlers and :formats directly as option:
729
- render :template => "foo", :formats => [:html, :js], :handlers => :erb
1121
+ * Forms of persisted records use always PATCH (via the `_method` hack). *fxn*
730
1122
 
731
- * Changed log level of warning for missing CSRF token from :debug to :warn. *Mike Dillon*
1123
+ * For resources, both PATCH and PUT are routed to the `update` action. *fxn*
732
1124
 
733
- * content_tag_for and div_for can now take the collection of records. It will also yield the record as the first argument if you set a receiving argument in your block *Prem Sichanugrist*
1125
+ * Don't ignore `force_ssl` in development. This is a change of behavior - use a `:if` condition to recreate the old behavior.
734
1126
 
735
- So instead of having to do this:
1127
+ class AccountsController < ApplicationController
1128
+ force_ssl if: :ssl_configured?
736
1129
 
737
- @items.each do |item|
738
- content_tag_for(:li, item) do
739
- Title: <%= item.title %>
1130
+ def ssl_configured?
1131
+ !Rails.env.development?
740
1132
  end
741
1133
  end
742
1134
 
743
- You can now do this:
1135
+ *Pat Allan*
744
1136
 
745
- content_tag_for(:li, @items) do |item|
746
- Title: <%= item.title %>
747
- end
1137
+ * Adds support for the PATCH verb:
1138
+ * Request objects respond to `patch?`.
1139
+ * Routes have a new `patch` method, and understand `:patch` in the
1140
+ existing places where a verb is configured, like `:via`.
1141
+ * New method `patch` available in functional tests.
1142
+ * If `:patch` is the default verb for updates, edits are
1143
+ tunneled as PATCH rather than as PUT, and routing acts accordingly.
1144
+ * New method `patch_via_redirect` available in integration tests.
1145
+
1146
+ *dlee*
1147
+
1148
+ * `expires_in` accepts a `must_revalidate` flag. If true, "must-revalidate"
1149
+ is added to the Cache-Control header. *fxn*
1150
+
1151
+ * Add `date_field` and `date_field_tag` helpers which render an `input[type="date"]` tag *Olek Janiszewski*
1152
+
1153
+ * Adds `image_url`, `javascript_url`, `stylesheet_url`, `audio_url`, `video_url`, and `font_url`
1154
+ to assets tag helper. These URL helpers will return the full path to your assets. This is useful
1155
+ when you are going to reference this asset from external host. *Prem Sichanugrist*
1156
+
1157
+ * Default responder will now always use your overridden block in `respond_with` to render your response. *Prem Sichanugrist*
1158
+
1159
+ * Allow `value_method` and `text_method` arguments from `collection_select` and
1160
+ `options_from_collection_for_select` to receive an object that responds to `:call`,
1161
+ such as a `proc`, to evaluate the option in the current element context. This works
1162
+ the same way with `collection_radio_buttons` and `collection_check_boxes`.
1163
+
1164
+ *Carlos Antonio da Silva + Rafael Mendonça França*
1165
+
1166
+ * Add `collection_check_boxes` form helper, similar to `collection_select`:
1167
+ Example:
1168
+
1169
+ collection_check_boxes :post, :author_ids, Author.all, :id, :name
1170
+ # Outputs something like:
1171
+ <input id="post_author_ids_1" name="post[author_ids][]" type="checkbox" value="1" />
1172
+ <label for="post_author_ids_1">D. Heinemeier Hansson</label>
1173
+ <input id="post_author_ids_2" name="post[author_ids][]" type="checkbox" value="2" />
1174
+ <label for="post_author_ids_2">D. Thomas</label>
1175
+ <input name="post[author_ids][]" type="hidden" value="" />
1176
+
1177
+ The label/check_box pairs can be customized with a block.
1178
+
1179
+ *Carlos Antonio da Silva + Rafael Mendonça França*
1180
+
1181
+ * Add `collection_radio_buttons` form helper, similar to `collection_select`:
1182
+ Example:
1183
+
1184
+ collection_radio_buttons :post, :author_id, Author.all, :id, :name
1185
+ # Outputs something like:
1186
+ <input id="post_author_id_1" name="post[author_id]" type="radio" value="1" />
1187
+ <label for="post_author_id_1">D. Heinemeier Hansson</label>
1188
+ <input id="post_author_id_2" name="post[author_id]" type="radio" value="2" />
1189
+ <label for="post_author_id_2">D. Thomas</label>
1190
+
1191
+ The label/radio_button pairs can be customized with a block.
1192
+
1193
+ *Carlos Antonio da Silva + Rafael Mendonça França*
1194
+
1195
+ * `check_box` with `:form` html5 attribute will now replicate the `:form`
1196
+ attribute to the hidden field as well. *Carlos Antonio da Silva*
1197
+
1198
+ * `label` form helper accepts `for: nil` to not generate the attribute. *Carlos Antonio da Silva*
1199
+
1200
+ * Add `:format` option to `number_to_percentage`. *Rodrigo Flores*
1201
+
1202
+ * Add `config.action_view.logger` to configure logger for Action View. *Rafael Mendonça França*
1203
+
1204
+ * Deprecated `ActionController::Integration` in favour of `ActionDispatch::Integration`.
748
1205
 
749
- * send_file now guess the mime type *Esad Hajdarevic*
1206
+ * Deprecated `ActionController::IntegrationTest` in favour of `ActionDispatch::IntegrationTest`.
750
1207
 
751
- * Mime type entries for PDF, ZIP and other formats were added *Esad Hajdarevic*
1208
+ * Deprecated `ActionController::PerformanceTest` in favour of `ActionDispatch::PerformanceTest`.
752
1209
 
753
- * Generate hidden input before select with :multiple option set to true.
754
- This is useful when you rely on the fact that when no options is set,
755
- the state of select will be sent to rails application. Without hidden field
756
- nothing is sent according to HTML spec *Bogdan Gusiev*
1210
+ * Deprecated `ActionController::AbstractRequest` in favour of `ActionDispatch::Request`.
757
1211
 
758
- * Refactor ActionController::TestCase cookies *Andrew White*
1212
+ * Deprecated `ActionController::Request` in favour of `ActionDispatch::Request`.
759
1213
 
760
- Assigning cookies for test cases should now use cookies[], e.g:
1214
+ * Deprecated `ActionController::AbstractResponse` in favour of `ActionDispatch::Response`.
761
1215
 
762
- cookies[:email] = 'user@example.com'
763
- get :index
764
- assert_equal 'user@example.com', cookies[:email]
1216
+ * Deprecated `ActionController::Response` in favour of `ActionDispatch::Response`.
765
1217
 
766
- To clear the cookies, use clear, e.g:
1218
+ * Deprecated `ActionController::Routing` in favour of `ActionDispatch::Routing`.
767
1219
 
768
- cookies.clear
769
- get :index
770
- assert_nil cookies[:email]
1220
+ * `check_box helper` with `disabled: true` will generate a disabled
1221
+ hidden field to conform with the HTML convention where disabled fields are
1222
+ not submitted with the form. This is a behavior change, previously the hidden
1223
+ tag had a value of the disabled checkbox. *Tadas Tamosauskas*
771
1224
 
772
- We now no longer write out HTTP_COOKIE and the cookie jar is
773
- persistent between requests so if you need to manipulate the environment
774
- for your test you need to do it before the cookie jar is created.
1225
+ * `favicon_link_tag` helper will now use the favicon in app/assets by default. *Lucas Caton*
775
1226
 
776
- * ActionController::ParamsWrapper on ActiveRecord models now only wrap
777
- attr_accessible attributes if they were set, if not, only the attributes
778
- returned by the class method attribute_names will be wrapped. This fixes
779
- the wrapping of nested attributes by adding them to attr_accessible.
1227
+ * `ActionView::Helpers::TextHelper#highlight` now defaults to the
1228
+ HTML5 `mark` element. *Brian Cardarella*
780
1229
 
781
- Please check [3-1-stable](https://github.com/rails/rails/blob/3-1-stable/actionpack/CHANGELOG.md) for previous changes.
1230
+ Please check [3-2-stable](https://github.com/rails/rails/blob/3-2-stable/actionpack/CHANGELOG.md) for previous changes.