actionpack 3.2.22.5 → 4.0.0.beta1

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