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.
- checksums.yaml +7 -0
- data/CHANGELOG.md +850 -401
- data/MIT-LICENSE +1 -1
- data/README.rdoc +5 -288
- data/lib/abstract_controller/asset_paths.rb +2 -2
- data/lib/abstract_controller/base.rb +39 -37
- data/lib/abstract_controller/callbacks.rb +101 -82
- data/lib/abstract_controller/collector.rb +7 -3
- data/lib/abstract_controller/helpers.rb +25 -13
- data/lib/abstract_controller/layouts.rb +74 -74
- data/lib/abstract_controller/logger.rb +1 -2
- data/lib/abstract_controller/rendering.rb +30 -13
- data/lib/abstract_controller/translation.rb +16 -1
- data/lib/abstract_controller/url_for.rb +6 -6
- data/lib/abstract_controller/view_paths.rb +1 -1
- data/lib/abstract_controller.rb +1 -8
- data/lib/action_controller/base.rb +46 -22
- data/lib/action_controller/caching/fragments.rb +23 -53
- data/lib/action_controller/caching.rb +46 -33
- data/lib/action_controller/deprecated/integration_test.rb +3 -0
- data/lib/action_controller/deprecated.rb +5 -1
- data/lib/action_controller/log_subscriber.rb +16 -8
- data/lib/action_controller/metal/conditional_get.rb +76 -32
- data/lib/action_controller/metal/data_streaming.rb +20 -26
- data/lib/action_controller/metal/exceptions.rb +19 -6
- data/lib/action_controller/metal/flash.rb +24 -9
- data/lib/action_controller/metal/force_ssl.rb +70 -12
- data/lib/action_controller/metal/head.rb +25 -4
- data/lib/action_controller/metal/helpers.rb +5 -9
- data/lib/action_controller/metal/hide_actions.rb +0 -1
- data/lib/action_controller/metal/http_authentication.rb +107 -83
- data/lib/action_controller/metal/implicit_render.rb +1 -1
- data/lib/action_controller/metal/instrumentation.rb +2 -1
- data/lib/action_controller/metal/live.rb +175 -0
- data/lib/action_controller/metal/mime_responds.rb +161 -47
- data/lib/action_controller/metal/params_wrapper.rb +112 -74
- data/lib/action_controller/metal/rack_delegation.rb +9 -3
- data/lib/action_controller/metal/redirecting.rb +15 -20
- data/lib/action_controller/metal/renderers.rb +11 -9
- data/lib/action_controller/metal/rendering.rb +9 -1
- data/lib/action_controller/metal/request_forgery_protection.rb +112 -19
- data/lib/action_controller/metal/responder.rb +20 -19
- data/lib/action_controller/metal/streaming.rb +12 -18
- data/lib/action_controller/metal/strong_parameters.rb +520 -0
- data/lib/action_controller/metal/testing.rb +13 -18
- data/lib/action_controller/metal/url_for.rb +28 -25
- data/lib/action_controller/metal.rb +17 -32
- data/lib/action_controller/model_naming.rb +12 -0
- data/lib/action_controller/railtie.rb +33 -17
- data/lib/action_controller/railties/helpers.rb +22 -0
- data/lib/action_controller/record_identifier.rb +18 -72
- data/lib/action_controller/test_case.rb +251 -131
- data/lib/action_controller/vendor/html-scanner.rb +4 -19
- data/lib/action_controller.rb +15 -6
- data/lib/action_dispatch/http/cache.rb +63 -11
- data/lib/action_dispatch/http/filter_parameters.rb +18 -8
- data/lib/action_dispatch/http/filter_redirect.rb +37 -0
- data/lib/action_dispatch/http/headers.rb +49 -17
- data/lib/action_dispatch/http/mime_negotiation.rb +24 -1
- data/lib/action_dispatch/http/mime_type.rb +154 -100
- data/lib/action_dispatch/http/mime_types.rb +1 -1
- data/lib/action_dispatch/http/parameter_filter.rb +44 -46
- data/lib/action_dispatch/http/parameters.rb +28 -28
- data/lib/action_dispatch/http/rack_cache.rb +2 -3
- data/lib/action_dispatch/http/request.rb +64 -18
- data/lib/action_dispatch/http/response.rb +130 -35
- data/lib/action_dispatch/http/upload.rb +63 -20
- data/lib/action_dispatch/http/url.rb +98 -35
- data/lib/action_dispatch/journey/backwards.rb +5 -0
- data/lib/action_dispatch/journey/formatter.rb +146 -0
- data/lib/action_dispatch/journey/gtg/builder.rb +162 -0
- data/lib/action_dispatch/journey/gtg/simulator.rb +44 -0
- data/lib/action_dispatch/journey/gtg/transition_table.rb +156 -0
- data/lib/action_dispatch/journey/nfa/builder.rb +76 -0
- data/lib/action_dispatch/journey/nfa/dot.rb +36 -0
- data/lib/action_dispatch/journey/nfa/simulator.rb +47 -0
- data/lib/action_dispatch/journey/nfa/transition_table.rb +163 -0
- data/lib/action_dispatch/journey/nodes/node.rb +124 -0
- data/lib/action_dispatch/journey/parser.rb +206 -0
- data/lib/action_dispatch/journey/parser.y +47 -0
- data/lib/action_dispatch/journey/parser_extras.rb +23 -0
- data/lib/action_dispatch/journey/path/pattern.rb +196 -0
- data/lib/action_dispatch/journey/route.rb +124 -0
- data/lib/action_dispatch/journey/router/strexp.rb +24 -0
- data/lib/action_dispatch/journey/router/utils.rb +54 -0
- data/lib/action_dispatch/journey/router.rb +166 -0
- data/lib/action_dispatch/journey/routes.rb +75 -0
- data/lib/action_dispatch/journey/scanner.rb +61 -0
- data/lib/action_dispatch/journey/visitors.rb +197 -0
- data/lib/action_dispatch/journey/visualizer/fsm.css +34 -0
- data/lib/action_dispatch/journey/visualizer/fsm.js +134 -0
- data/lib/action_dispatch/journey/visualizer/index.html.erb +52 -0
- data/lib/action_dispatch/journey.rb +5 -0
- data/lib/action_dispatch/middleware/callbacks.rb +9 -4
- data/lib/action_dispatch/middleware/cookies.rb +259 -114
- data/lib/action_dispatch/middleware/debug_exceptions.rb +26 -17
- data/lib/action_dispatch/middleware/exception_wrapper.rb +29 -3
- data/lib/action_dispatch/middleware/flash.rb +58 -58
- data/lib/action_dispatch/middleware/params_parser.rb +14 -29
- data/lib/action_dispatch/middleware/public_exceptions.rb +30 -14
- data/lib/action_dispatch/middleware/reloader.rb +6 -6
- data/lib/action_dispatch/middleware/remote_ip.rb +145 -39
- data/lib/action_dispatch/middleware/request_id.rb +2 -6
- data/lib/action_dispatch/middleware/session/abstract_store.rb +22 -20
- data/lib/action_dispatch/middleware/session/cookie_store.rb +82 -28
- data/lib/action_dispatch/middleware/session/mem_cache_store.rb +8 -3
- data/lib/action_dispatch/middleware/show_exceptions.rb +12 -45
- data/lib/action_dispatch/middleware/ssl.rb +70 -0
- data/lib/action_dispatch/middleware/stack.rb +6 -1
- data/lib/action_dispatch/middleware/static.rb +2 -1
- data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb +14 -11
- data/lib/action_dispatch/middleware/templates/rescues/_source.erb +25 -0
- data/lib/action_dispatch/middleware/templates/rescues/_trace.erb +7 -9
- data/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb +15 -9
- data/lib/action_dispatch/middleware/templates/rescues/layout.erb +127 -5
- data/lib/action_dispatch/middleware/templates/rescues/missing_template.erb +7 -2
- data/lib/action_dispatch/middleware/templates/rescues/routing_error.erb +30 -15
- data/lib/action_dispatch/middleware/templates/rescues/template_error.erb +39 -13
- data/lib/action_dispatch/middleware/templates/rescues/unknown_action.erb +6 -2
- data/lib/action_dispatch/middleware/templates/routes/_route.html.erb +16 -0
- data/lib/action_dispatch/middleware/templates/routes/_table.html.erb +144 -0
- data/lib/action_dispatch/railtie.rb +16 -6
- data/lib/action_dispatch/request/session.rb +181 -0
- data/lib/action_dispatch/routing/inspector.rb +240 -0
- data/lib/action_dispatch/routing/mapper.rb +540 -291
- data/lib/action_dispatch/routing/polymorphic_routes.rb +16 -20
- data/lib/action_dispatch/routing/redirection.rb +46 -29
- data/lib/action_dispatch/routing/route_set.rb +207 -164
- data/lib/action_dispatch/routing/routes_proxy.rb +2 -0
- data/lib/action_dispatch/routing/url_for.rb +48 -33
- data/lib/action_dispatch/routing.rb +48 -83
- data/lib/action_dispatch/testing/assertions/dom.rb +3 -13
- data/lib/action_dispatch/testing/assertions/response.rb +32 -40
- data/lib/action_dispatch/testing/assertions/routing.rb +42 -41
- data/lib/action_dispatch/testing/assertions/selector.rb +17 -22
- data/lib/action_dispatch/testing/assertions/tag.rb +20 -23
- data/lib/action_dispatch/testing/integration.rb +65 -51
- data/lib/action_dispatch/testing/test_process.rb +9 -6
- data/lib/action_dispatch/testing/test_request.rb +7 -3
- data/lib/action_dispatch.rb +21 -15
- data/lib/action_pack/version.rb +7 -6
- data/lib/action_pack.rb +1 -1
- data/lib/action_view/base.rb +15 -34
- data/lib/action_view/buffers.rb +7 -1
- data/lib/action_view/context.rb +4 -4
- data/lib/action_view/dependency_tracker.rb +93 -0
- data/lib/action_view/digestor.rb +85 -0
- data/lib/action_view/flows.rb +1 -4
- data/lib/action_view/helpers/active_model_helper.rb +3 -4
- data/lib/action_view/helpers/asset_tag_helper.rb +215 -352
- data/lib/action_view/helpers/asset_url_helper.rb +355 -0
- data/lib/action_view/helpers/atom_feed_helper.rb +13 -10
- data/lib/action_view/helpers/cache_helper.rb +150 -18
- data/lib/action_view/helpers/capture_helper.rb +44 -31
- data/lib/action_view/helpers/csrf_helper.rb +0 -2
- data/lib/action_view/helpers/date_helper.rb +269 -248
- data/lib/action_view/helpers/debug_helper.rb +10 -11
- data/lib/action_view/helpers/form_helper.rb +931 -537
- data/lib/action_view/helpers/form_options_helper.rb +341 -166
- data/lib/action_view/helpers/form_tag_helper.rb +190 -90
- data/lib/action_view/helpers/javascript_helper.rb +23 -16
- data/lib/action_view/helpers/number_helper.rb +148 -329
- data/lib/action_view/helpers/output_safety_helper.rb +3 -3
- data/lib/action_view/helpers/record_tag_helper.rb +17 -22
- data/lib/action_view/helpers/rendering_helper.rb +2 -2
- data/lib/action_view/helpers/sanitize_helper.rb +3 -6
- data/lib/action_view/helpers/tag_helper.rb +46 -33
- data/lib/action_view/helpers/tags/base.rb +147 -0
- data/lib/action_view/helpers/tags/check_box.rb +64 -0
- data/lib/action_view/helpers/tags/checkable.rb +16 -0
- data/lib/action_view/helpers/tags/collection_check_boxes.rb +43 -0
- data/lib/action_view/helpers/tags/collection_helpers.rb +83 -0
- data/lib/action_view/helpers/tags/collection_radio_buttons.rb +36 -0
- data/lib/action_view/helpers/tags/collection_select.rb +28 -0
- data/lib/action_view/helpers/tags/color_field.rb +25 -0
- data/lib/action_view/helpers/tags/date_field.rb +13 -0
- data/lib/action_view/helpers/tags/date_select.rb +72 -0
- data/lib/action_view/helpers/tags/datetime_field.rb +22 -0
- data/lib/action_view/helpers/tags/datetime_local_field.rb +19 -0
- data/lib/action_view/helpers/tags/datetime_select.rb +8 -0
- data/lib/action_view/helpers/tags/email_field.rb +8 -0
- data/lib/action_view/helpers/tags/file_field.rb +8 -0
- data/lib/action_view/helpers/tags/grouped_collection_select.rb +29 -0
- data/lib/action_view/helpers/tags/hidden_field.rb +8 -0
- data/lib/action_view/helpers/tags/label.rb +65 -0
- data/lib/action_view/helpers/tags/month_field.rb +13 -0
- data/lib/action_view/helpers/tags/number_field.rb +18 -0
- data/lib/action_view/helpers/tags/password_field.rb +12 -0
- data/lib/action_view/helpers/tags/radio_button.rb +31 -0
- data/lib/action_view/helpers/tags/range_field.rb +8 -0
- data/lib/action_view/helpers/tags/search_field.rb +24 -0
- data/lib/action_view/helpers/tags/select.rb +40 -0
- data/lib/action_view/helpers/tags/tel_field.rb +8 -0
- data/lib/action_view/helpers/tags/text_area.rb +18 -0
- data/lib/action_view/helpers/tags/text_field.rb +29 -0
- data/lib/action_view/helpers/tags/time_field.rb +13 -0
- data/lib/action_view/helpers/tags/time_select.rb +8 -0
- data/lib/action_view/helpers/tags/time_zone_select.rb +20 -0
- data/lib/action_view/helpers/tags/url_field.rb +8 -0
- data/lib/action_view/helpers/tags/week_field.rb +13 -0
- data/lib/action_view/helpers/tags.rb +39 -0
- data/lib/action_view/helpers/text_helper.rb +130 -114
- data/lib/action_view/helpers/translation_helper.rb +32 -16
- data/lib/action_view/helpers/url_helper.rb +211 -270
- data/lib/action_view/helpers.rb +2 -4
- data/lib/action_view/locale/en.yml +1 -105
- data/lib/action_view/log_subscriber.rb +6 -4
- data/lib/action_view/lookup_context.rb +15 -28
- data/lib/action_view/model_naming.rb +12 -0
- data/lib/action_view/path_set.rb +8 -20
- data/lib/action_view/railtie.rb +6 -22
- data/lib/action_view/record_identifier.rb +84 -0
- data/lib/action_view/renderer/abstract_renderer.rb +25 -19
- data/lib/action_view/renderer/partial_renderer.rb +158 -81
- data/lib/action_view/renderer/renderer.rb +8 -12
- data/lib/action_view/renderer/streaming_template_renderer.rb +2 -5
- data/lib/action_view/renderer/template_renderer.rb +12 -10
- data/lib/action_view/routing_url_for.rb +107 -0
- data/lib/action_view/template/error.rb +22 -12
- data/lib/action_view/template/handlers/builder.rb +1 -1
- data/lib/action_view/template/handlers/erb.rb +40 -19
- data/lib/action_view/template/handlers/raw.rb +11 -0
- data/lib/action_view/template/handlers.rb +12 -9
- data/lib/action_view/template/resolver.rb +107 -53
- data/lib/action_view/template/text.rb +12 -8
- data/lib/action_view/template/types.rb +57 -0
- data/lib/action_view/template.rb +25 -23
- data/lib/action_view/test_case.rb +67 -42
- data/lib/{action_controller → action_view}/vendor/html-scanner/html/document.rb +0 -0
- data/lib/{action_controller → action_view}/vendor/html-scanner/html/node.rb +12 -12
- data/lib/{action_controller → action_view}/vendor/html-scanner/html/sanitizer.rb +13 -2
- data/lib/{action_controller → action_view}/vendor/html-scanner/html/selector.rb +9 -9
- data/lib/{action_controller → action_view}/vendor/html-scanner/html/tokenizer.rb +1 -1
- data/lib/{action_controller → action_view}/vendor/html-scanner/html/version.rb +0 -0
- data/lib/action_view/vendor/html-scanner.rb +20 -0
- data/lib/action_view.rb +17 -8
- metadata +184 -214
- data/lib/action_controller/caching/actions.rb +0 -185
- data/lib/action_controller/caching/pages.rb +0 -187
- data/lib/action_controller/caching/sweeping.rb +0 -97
- data/lib/action_controller/deprecated/performance_test.rb +0 -1
- data/lib/action_controller/metal/compatibility.rb +0 -65
- data/lib/action_controller/metal/session_management.rb +0 -14
- data/lib/action_controller/railties/paths.rb +0 -25
- data/lib/action_dispatch/middleware/best_standards_support.rb +0 -30
- data/lib/action_dispatch/middleware/body_proxy.rb +0 -30
- data/lib/action_dispatch/middleware/head.rb +0 -18
- data/lib/action_dispatch/middleware/rescue.rb +0 -26
- data/lib/action_dispatch/testing/performance_test.rb +0 -10
- data/lib/action_view/asset_paths.rb +0 -142
- data/lib/action_view/helpers/asset_paths.rb +0 -7
- data/lib/action_view/helpers/asset_tag_helpers/asset_include_tag.rb +0 -146
- data/lib/action_view/helpers/asset_tag_helpers/asset_paths.rb +0 -93
- data/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb +0 -193
- data/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb +0 -148
- data/lib/sprockets/assets.rake +0 -99
- data/lib/sprockets/bootstrap.rb +0 -37
- data/lib/sprockets/compressors.rb +0 -83
- data/lib/sprockets/helpers/isolated_helper.rb +0 -13
- data/lib/sprockets/helpers/rails_helper.rb +0 -182
- data/lib/sprockets/helpers.rb +0 -6
- data/lib/sprockets/railtie.rb +0 -62
- data/lib/sprockets/static_compiler.rb +0 -56
data/CHANGELOG.md
CHANGED
|
@@ -1,389 +1,693 @@
|
|
|
1
|
-
## Rails
|
|
1
|
+
## Rails 4.0.0 (June 25, 2013) ##
|
|
2
2
|
|
|
3
|
-
*
|
|
4
|
-
`
|
|
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
|
-
|
|
8
|
+
Fixes #9856
|
|
7
9
|
|
|
8
|
-
*
|
|
10
|
+
*Yves Senn*, *Andrew White*
|
|
9
11
|
|
|
12
|
+
* Use a case insensitive URI Regexp for #asset_path.
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
This fix a problem where the same asset path using different case are generating
|
|
15
|
+
different URIs.
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
Before:
|
|
14
18
|
|
|
15
|
-
|
|
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
|
-
|
|
24
|
+
After:
|
|
18
25
|
|
|
19
|
-
|
|
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
|
-
|
|
33
|
+
* Fix an issue where partials with a number in the filename weren't being digested for cache dependencies.
|
|
23
34
|
|
|
24
|
-
*
|
|
35
|
+
*Bryan Ricker*
|
|
25
36
|
|
|
26
|
-
|
|
37
|
+
* Add support for passing custom url options other than `:host` and custom
|
|
38
|
+
status and flash options to `force_ssl`.
|
|
27
39
|
|
|
28
|
-
*
|
|
40
|
+
*Andrew White*
|
|
29
41
|
|
|
30
|
-
|
|
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
|
-
|
|
49
|
+
*Andrew White*
|
|
34
50
|
|
|
35
|
-
*
|
|
51
|
+
* Return a 405 Method Not Allowed response when a request contains an unknown
|
|
52
|
+
HTTP method.
|
|
36
53
|
|
|
37
|
-
*
|
|
54
|
+
*Lewis Marshall*
|
|
38
55
|
|
|
39
|
-
*
|
|
56
|
+
* Add support for extracting the port from the `:host` option passed to `url_for`.
|
|
40
57
|
|
|
41
|
-
*
|
|
58
|
+
*Andrew White*
|
|
42
59
|
|
|
43
|
-
|
|
60
|
+
* Add support for removing the subdomain from a url by passing `nil`, `false` or `''`.
|
|
61
|
+
Fixes #10180.
|
|
44
62
|
|
|
45
|
-
*
|
|
46
|
-
attacks if both `HTTP_CLIENT_IP` and `HTTP_X_FORWARDED_FOR` are set.
|
|
63
|
+
*Derek Watson + Andrew White*
|
|
47
64
|
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
*
|
|
69
|
+
*Vasiliy Ermolovich*
|
|
52
70
|
|
|
53
|
-
* Fix
|
|
54
|
-
|
|
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
|
-
|
|
57
|
-
Backport #5219
|
|
77
|
+
*Ryan McGeary*
|
|
58
78
|
|
|
59
|
-
|
|
79
|
+
* Add block support for the `mail_to` helper, similar to the `link_to` helper.
|
|
60
80
|
|
|
61
|
-
*
|
|
81
|
+
*Sam Pohlenz*
|
|
62
82
|
|
|
63
|
-
|
|
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
|
-
*
|
|
66
|
-
does not show user-supplied message.
|
|
92
|
+
*Trevor Turk*
|
|
67
93
|
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
97
|
+
All of the following layouts will result in the default layout lookup:
|
|
73
98
|
|
|
99
|
+
layout nil
|
|
74
100
|
|
|
75
|
-
|
|
101
|
+
layout proc { nil }
|
|
76
102
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
103
|
+
layout :returns_nil
|
|
104
|
+
def returns_nil
|
|
105
|
+
nil
|
|
106
|
+
end
|
|
81
107
|
|
|
82
|
-
|
|
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
|
-
*
|
|
112
|
+
*Chris Nicola*
|
|
85
113
|
|
|
86
|
-
*
|
|
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
|
-
|
|
117
|
+
*Trevor Turk + Neeraj Singh*
|
|
89
118
|
|
|
90
|
-
|
|
91
|
-
# => "<b>Showing</b>"
|
|
119
|
+
* Raise an `ArgumentError` when a clashing named route is defined.
|
|
92
120
|
|
|
93
|
-
|
|
121
|
+
*Trevor Turk*
|
|
94
122
|
|
|
95
|
-
|
|
96
|
-
# => "<b>Showing</b>"
|
|
123
|
+
* Allow default url options to accept host with protocol such as `http://`
|
|
97
124
|
|
|
98
|
-
|
|
125
|
+
config.action_mailer.default_url_options = { host: "http://mydomain.com" }
|
|
99
126
|
|
|
100
|
-
*
|
|
127
|
+
*Richard Schneeman*
|
|
101
128
|
|
|
102
|
-
|
|
103
|
-
|
|
129
|
+
* Ensure that digest authentication responds with a 401 status when a basic
|
|
130
|
+
header is received.
|
|
104
131
|
|
|
105
|
-
|
|
132
|
+
*Brad Dunbar*
|
|
106
133
|
|
|
107
|
-
|
|
108
|
-
|
|
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
|
-
|
|
137
|
+
*Juan Barreneche*
|
|
113
138
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
-
|
|
143
|
+
Example:
|
|
120
144
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
149
|
+
# functional test
|
|
150
|
+
@request.headers["Accepts"] = "text/plain, text/html"
|
|
128
151
|
|
|
129
|
-
*
|
|
152
|
+
*Yves Senn*
|
|
130
153
|
|
|
131
|
-
|
|
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
|
-
|
|
156
|
+
*Yves Senn*
|
|
135
157
|
|
|
136
|
-
|
|
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
|
-
|
|
139
|
-
Fixes #9799.
|
|
161
|
+
Before:
|
|
140
162
|
|
|
141
|
-
|
|
163
|
+
select(:category, [], {}, multiple: true, name: "post[category][]")
|
|
164
|
+
# => <select name="post[category][][]" ...>
|
|
142
165
|
|
|
143
|
-
|
|
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
|
-
|
|
168
|
+
select(:category, [], {}, multiple: true, name: "post[category][]")
|
|
169
|
+
# => <select name="post[category][]" ...>
|
|
148
170
|
|
|
149
|
-
|
|
150
|
-
number_to_human(123, units: { thousand: 'k' }) # => 123
|
|
171
|
+
*Olek Janiszewski*
|
|
151
172
|
|
|
152
|
-
|
|
153
|
-
|
|
173
|
+
* Fixed regression when using `assert_template` to verify files sent using
|
|
174
|
+
`render file: 'README.md'`.
|
|
175
|
+
Fixes #9464.
|
|
154
176
|
|
|
155
|
-
*
|
|
177
|
+
*Justin Coyne*
|
|
156
178
|
|
|
157
|
-
*
|
|
158
|
-
|
|
179
|
+
* Fixed `ActionView::Helpers::CaptureHelper#content_for` regression when trying to use it in
|
|
180
|
+
a boolean statement.
|
|
181
|
+
Fixes #9360.
|
|
159
182
|
|
|
160
|
-
*
|
|
183
|
+
*Nikolay Shebanov*
|
|
161
184
|
|
|
162
|
-
*
|
|
163
|
-
|
|
185
|
+
* `format: true` does not override existing format constraints.
|
|
186
|
+
Fixes #9466.
|
|
164
187
|
|
|
165
|
-
|
|
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
|
-
|
|
193
|
+
*Yves Senn*
|
|
169
194
|
|
|
170
|
-
*
|
|
171
|
-
|
|
195
|
+
* Skip valid encoding checks for non-String parameters that come
|
|
196
|
+
from the matched route's defaults.
|
|
197
|
+
Fixes #9435.
|
|
172
198
|
|
|
173
|
-
|
|
199
|
+
Example:
|
|
174
200
|
|
|
175
|
-
|
|
176
|
-
# => <select name="post[category][][]" ...>
|
|
201
|
+
root to: 'main#posts', page: 1
|
|
177
202
|
|
|
178
|
-
|
|
203
|
+
*Yves Senn*
|
|
179
204
|
|
|
180
|
-
|
|
181
|
-
|
|
205
|
+
* Don't verify Regexp requirements for non-Regexp `:constraints`.
|
|
206
|
+
Fixes #9432.
|
|
207
|
+
|
|
208
|
+
Example:
|
|
182
209
|
|
|
183
|
-
|
|
210
|
+
get '/photos.:format' => 'feeds#photos', constraints: {format: 'xml'}
|
|
184
211
|
|
|
185
|
-
*
|
|
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
|
-
#
|
|
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
|
-
*
|
|
203
|
-
|
|
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
|
-
*
|
|
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
|
-
|
|
209
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
214
|
-
|
|
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
|
-
*
|
|
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 ["foo", "bar"]" 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
|
-
*
|
|
223
|
-
|
|
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
|
-
|
|
388
|
+
* Added view_cache_dependency API for declaring dependencies that affect
|
|
389
|
+
cache digest computation.
|
|
226
390
|
|
|
227
|
-
*
|
|
391
|
+
*Jamis Buck*
|
|
228
392
|
|
|
229
|
-
|
|
393
|
+
* `image_submit_tag` will set `alt` attribute from image source if not
|
|
394
|
+
specified.
|
|
230
395
|
|
|
231
|
-
*
|
|
396
|
+
*Nihad Abbasov*
|
|
232
397
|
|
|
233
|
-
|
|
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
|
-
|
|
238
|
-
Backport #8701.
|
|
417
|
+
root_url(trailing_slash: true) # => http://test.host//
|
|
239
418
|
|
|
240
|
-
|
|
241
|
-
# before
|
|
242
|
-
root_url # => http://test.host//
|
|
419
|
+
After:
|
|
243
420
|
|
|
244
|
-
#
|
|
245
|
-
root_url # => http://test.host/
|
|
421
|
+
root_url(trailing_slash: true) # => http://test.host/
|
|
246
422
|
|
|
247
423
|
*Yves Senn*
|
|
248
424
|
|
|
249
|
-
*
|
|
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
|
-
*
|
|
254
|
-
|
|
255
|
-
|
|
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 :
|
|
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
|
-
*
|
|
539
|
+
* Sweepers was extracted from Action Controller as `rails-observers` gem.
|
|
275
540
|
|
|
276
|
-
*
|
|
541
|
+
*Rafael Mendonça França*
|
|
277
542
|
|
|
278
|
-
*
|
|
279
|
-
Before:
|
|
543
|
+
* Add option flag to `CacheHelper#cache` to manually bypass automatic template digests:
|
|
280
544
|
|
|
281
|
-
|
|
282
|
-
|
|
545
|
+
<% cache project, skip_digest: true do %>
|
|
546
|
+
...
|
|
547
|
+
<% end %>
|
|
283
548
|
|
|
284
|
-
|
|
549
|
+
*Drew Ulmer*
|
|
285
550
|
|
|
286
|
-
|
|
551
|
+
* Do not sort Hash options in `grouped_options_for_select`. *Sergey Kojin*
|
|
287
552
|
|
|
288
|
-
|
|
553
|
+
* Accept symbols as `send_data :disposition` value *Elia Schito*
|
|
289
554
|
|
|
290
|
-
|
|
555
|
+
* Add i18n scope to `distance_of_time_in_words`. *Steve Klabnik*
|
|
291
556
|
|
|
292
|
-
*
|
|
293
|
-
|
|
294
|
-
|
|
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
|
-
*
|
|
561
|
+
*Roberto Soares*
|
|
298
562
|
|
|
299
|
-
*
|
|
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
|
-
|
|
565
|
+
scope :api do
|
|
566
|
+
resources :users
|
|
567
|
+
end
|
|
303
568
|
|
|
304
|
-
|
|
305
|
-
Fix #7842
|
|
569
|
+
It is also possible to pass multiple symbols to scope to shorten multiple nested scopes:
|
|
306
570
|
|
|
307
|
-
|
|
571
|
+
scope :api do
|
|
572
|
+
scope :v1 do
|
|
573
|
+
resources :users
|
|
574
|
+
end
|
|
575
|
+
end
|
|
308
576
|
|
|
309
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
595
|
+
*tumayun + Carlos Antonio da Silva*
|
|
322
596
|
|
|
323
|
-
|
|
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
|
-
|
|
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 & Joe` for the whitelisted mime types. The default whitelist
|
|
606
|
+
contains `text/plain`.
|
|
607
|
+
Fixes #7976.
|
|
327
608
|
|
|
328
|
-
*
|
|
609
|
+
*Joost Baaij*
|
|
329
610
|
|
|
611
|
+
* Fix input name when `multiple: true` and `:index` are set.
|
|
330
612
|
|
|
331
|
-
|
|
613
|
+
Before:
|
|
332
614
|
|
|
333
|
-
|
|
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
|
-
|
|
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
|
-
|
|
623
|
+
Fixes #8108.
|
|
339
624
|
|
|
625
|
+
*Daniel Fox, Grant Hutchins & Trace Wax*
|
|
340
626
|
|
|
341
|
-
|
|
627
|
+
* `date_select` helper accepts `with_css_classes: true` to add css classes similar with type
|
|
628
|
+
of generated select tags.
|
|
342
629
|
|
|
343
|
-
*
|
|
630
|
+
*Pavel Nikitin*
|
|
344
631
|
|
|
345
|
-
|
|
632
|
+
* Only non-js/css under `app/assets` path will be included in default `config.assets.precompile`.
|
|
346
633
|
|
|
347
|
-
*
|
|
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
|
-
|
|
636
|
+
* Remove support for the `RAILS_ASSET_ID` environment configuration
|
|
637
|
+
(no longer needed now that we have the asset pipeline).
|
|
352
638
|
|
|
353
|
-
*
|
|
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
|
-
|
|
641
|
+
* Remove old `asset_path` configuration (no longer needed now that we have the asset pipeline).
|
|
359
642
|
|
|
360
|
-
*
|
|
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
|
-
|
|
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
|
-
*
|
|
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
|
-
|
|
657
|
+
Fixes #3415.
|
|
372
658
|
|
|
373
659
|
*Yves Senn*
|
|
374
660
|
|
|
375
|
-
*
|
|
376
|
-
|
|
377
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
420
|
-
|
|
421
|
-
|
|
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
|
-
*
|
|
731
|
+
*Michael Grosser*
|
|
424
732
|
|
|
425
|
-
*
|
|
733
|
+
* `ActionDispatch::Http::UploadedFile` now delegates `close` to its tempfile. *Sergio Gil*
|
|
426
734
|
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
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
|
-
*
|
|
741
|
+
*DHH + Guillermo Iguaran*
|
|
433
742
|
|
|
434
|
-
*
|
|
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
|
-
*
|
|
439
|
-
Fixes #7431.
|
|
754
|
+
* Allow pass couple extensions to `ActionView::Template.register_template_handler` call.
|
|
440
755
|
|
|
441
|
-
*
|
|
756
|
+
*Tima Maslyuchenko*
|
|
442
757
|
|
|
443
|
-
*
|
|
444
|
-
|
|
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
|
-
*
|
|
761
|
+
*Guillermo Iguaran*
|
|
447
762
|
|
|
448
|
-
* `
|
|
763
|
+
* `ActionDispatch::Session::MemCacheStore` now uses `dalli` instead of the deprecated
|
|
764
|
+
`memcache-client` gem.
|
|
449
765
|
|
|
450
|
-
*
|
|
451
|
-
Fixes GH#3047, GH#2483.
|
|
766
|
+
*Arun Agrawal + Guillermo Iguaran*
|
|
452
767
|
|
|
453
|
-
|
|
768
|
+
* Support multiple etags in If-None-Match header. *Travis Warlick*
|
|
454
769
|
|
|
455
|
-
*
|
|
456
|
-
|
|
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
|
-
|
|
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
|
-
|
|
780
|
+
New applications are generated with:
|
|
463
781
|
|
|
464
|
-
|
|
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
|
-
*
|
|
784
|
+
*Sergey Nartimov*
|
|
470
785
|
|
|
471
|
-
*
|
|
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
|
-
|
|
788
|
+
* Add `separator` option for `ActionView::Helpers::TextHelper#excerpt`:
|
|
477
789
|
|
|
478
|
-
|
|
790
|
+
excerpt('This is a very beautiful morning', 'very', separator: ' ', radius: 1)
|
|
791
|
+
# => ...a very beautiful...
|
|
479
792
|
|
|
480
|
-
*
|
|
793
|
+
*Guirec Corbel*
|
|
481
794
|
|
|
482
|
-
*
|
|
795
|
+
* Added controller-level etag additions that will be part of the action etag computation *Jeremy Kemper/DHH*
|
|
483
796
|
|
|
484
|
-
|
|
797
|
+
class InvoicesController < ApplicationController
|
|
798
|
+
etag { current_user.try :id }
|
|
485
799
|
|
|
486
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
812
|
+
*Richard Schneeman*
|
|
492
813
|
|
|
493
|
-
*
|
|
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
|
-
*
|
|
820
|
+
*Piotr Sarnacki*
|
|
496
821
|
|
|
497
|
-
*
|
|
822
|
+
* Fix `ActionView::RecordIdentifier` to work as a singleton. *Piotr Sarnacki*
|
|
498
823
|
|
|
499
|
-
*
|
|
824
|
+
* Deprecate `Template#mime_type`, it will be removed in Rails 4.1 in favor of `#type`.
|
|
825
|
+
*Piotr Sarnacki*
|
|
500
826
|
|
|
501
|
-
*
|
|
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
|
-
*
|
|
831
|
+
* Fix handling of date selects when using both disabled and discard options.
|
|
832
|
+
Fixes #7431.
|
|
504
833
|
|
|
505
|
-
*
|
|
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
|
-
|
|
840
|
+
* Fix `select_tag` when `option_tags` is nil.
|
|
841
|
+
Fixes #7404.
|
|
509
842
|
|
|
510
|
-
*
|
|
843
|
+
*Sandeep Ravichandran*
|
|
511
844
|
|
|
512
|
-
|
|
845
|
+
* Add `Request#formats=(extensions)` that lets you set multiple formats directly in a prioritized order.
|
|
513
846
|
|
|
514
|
-
|
|
847
|
+
Example of using this for custom iphone views with an HTML fallback:
|
|
515
848
|
|
|
516
|
-
|
|
849
|
+
class ApplicationController < ActionController::Base
|
|
850
|
+
before_filter :adjust_format_for_iphone_with_html_fallback
|
|
517
851
|
|
|
518
|
-
|
|
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
|
-
*
|
|
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
|
-
|
|
863
|
+
Code before:
|
|
524
864
|
|
|
525
|
-
|
|
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
|
-
|
|
874
|
+
Code after:
|
|
529
875
|
|
|
530
|
-
|
|
876
|
+
concern :commentable do
|
|
877
|
+
resources :comments
|
|
878
|
+
end
|
|
531
879
|
|
|
532
|
-
|
|
880
|
+
concern :image_attachable do
|
|
881
|
+
resources :images, only: :index
|
|
882
|
+
end
|
|
533
883
|
|
|
534
|
-
|
|
884
|
+
resources :messages, concerns: :commentable
|
|
535
885
|
|
|
536
|
-
|
|
886
|
+
resources :posts, concerns: [:commentable, :image_attachable]
|
|
537
887
|
|
|
538
|
-
*
|
|
888
|
+
*DHH + Rafael Mendonça França*
|
|
539
889
|
|
|
540
|
-
*
|
|
890
|
+
* Add `start_hour` and `end_hour` options to the `select_hour` helper. *Evan Tann*
|
|
541
891
|
|
|
542
|
-
*
|
|
892
|
+
* Raises an `ArgumentError` when the first argument in `form_for` contain `nil`
|
|
893
|
+
or is empty.
|
|
543
894
|
|
|
544
|
-
*
|
|
545
|
-
with regression from 16ee611fa
|
|
895
|
+
*Richard Schneeman*
|
|
546
896
|
|
|
547
|
-
*
|
|
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
|
-
*
|
|
902
|
+
*Egor Homakov*
|
|
550
903
|
|
|
551
|
-
*
|
|
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
|
-
|
|
908
|
+
We recommend the use of Unobtrusive JavaScript instead. For example:
|
|
556
909
|
|
|
557
|
-
|
|
910
|
+
link_to "Greeting", "#", class: "nav_link"
|
|
558
911
|
|
|
559
|
-
|
|
912
|
+
$(function() {
|
|
913
|
+
$('.nav_link').click(function() {
|
|
914
|
+
// Some complex code
|
|
560
915
|
|
|
561
|
-
|
|
916
|
+
return false;
|
|
917
|
+
});
|
|
918
|
+
});
|
|
562
919
|
|
|
563
|
-
|
|
920
|
+
or
|
|
564
921
|
|
|
565
|
-
|
|
922
|
+
link_to "Greeting", '#', onclick: "alert('Hello world!'); return false", class: "nav_link"
|
|
566
923
|
|
|
567
|
-
|
|
924
|
+
for simple cases.
|
|
568
925
|
|
|
569
|
-
*
|
|
570
|
-
check that info. Closes #5245. *Santiago Pastorino*
|
|
926
|
+
*Rafael Mendonça França*
|
|
571
927
|
|
|
572
|
-
*
|
|
928
|
+
* `javascript_include_tag :all` will now not include `application.js` if the file does not exists. *Prem Sichanugrist*
|
|
573
929
|
|
|
574
|
-
*
|
|
930
|
+
* Send an empty response body when call `head` with status between 100 and 199, 204, 205 or 304.
|
|
575
931
|
|
|
576
|
-
*
|
|
932
|
+
*Armand du Plessis*
|
|
577
933
|
|
|
578
|
-
*
|
|
934
|
+
* Fixed issue with where digest authentication would not work behind a proxy. *Arthur Smith*
|
|
579
935
|
|
|
580
|
-
*
|
|
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
|
-
|
|
939
|
+
class FooController < ActionController::Base
|
|
940
|
+
include ActionController::Live
|
|
583
941
|
|
|
584
|
-
|
|
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
|
-
|
|
954
|
+
* Remove `ActionDispatch::Head` middleware in favor of `Rack::Head`. *Santiago Pastorino*
|
|
588
955
|
|
|
589
|
-
*
|
|
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
|
-
*
|
|
958
|
+
*Carlos Galdino + Rafael Mendonça França*
|
|
592
959
|
|
|
593
|
-
*
|
|
960
|
+
* Show routes in exception page while debugging a `RoutingError` in development.
|
|
594
961
|
|
|
595
|
-
*
|
|
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
|
-
|
|
966
|
+
class ApplicationController
|
|
967
|
+
add_flash_types :error, :warning
|
|
968
|
+
end
|
|
601
969
|
|
|
602
|
-
|
|
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
|
-
*
|
|
972
|
+
*kennyj*
|
|
605
973
|
|
|
606
|
-
*
|
|
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
|
-
|
|
978
|
+
get Rack::Utils.escape('こんにちは') => 'home#index'
|
|
610
979
|
|
|
611
|
-
|
|
980
|
+
You just have to write the unicode route:
|
|
612
981
|
|
|
613
|
-
|
|
982
|
+
get 'こんにちは' => 'home#index'
|
|
614
983
|
|
|
615
|
-
*
|
|
984
|
+
*kennyj*
|
|
616
985
|
|
|
617
|
-
*
|
|
986
|
+
* Return proper format on exceptions. *Santiago Pastorino*
|
|
618
987
|
|
|
619
|
-
*
|
|
988
|
+
* Allow to use `mounted_helpers` (helpers for accessing mounted engines) in `ActionView::TestCase`. *Piotr Sarnacki*
|
|
620
989
|
|
|
621
|
-
*
|
|
990
|
+
* Include `mounted_helpers` (helpers for accessing mounted engines) in `ActionDispatch::IntegrationTest` by default. *Piotr Sarnacki*
|
|
622
991
|
|
|
623
|
-
*
|
|
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
|
-
*
|
|
994
|
+
*Jeremy Friesen*
|
|
627
995
|
|
|
628
|
-
*
|
|
629
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
1010
|
+
*Sergey Nartimov*
|
|
635
1011
|
|
|
636
|
-
*
|
|
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
|
-
*
|
|
1021
|
+
*Piotr Sarnacki*
|
|
639
1022
|
|
|
640
|
-
*
|
|
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
|
-
*
|
|
1026
|
+
*Li Ellis Gallardo + Rafael Mendonça França*
|
|
643
1027
|
|
|
644
|
-
|
|
1028
|
+
* `truncate` now accepts a block to show extra content when the text is truncated. *Li Ellis Gallardo*
|
|
645
1029
|
|
|
646
|
-
|
|
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
|
-
|
|
649
|
-
<%= f.button %>
|
|
650
|
-
<% end %>
|
|
1033
|
+
* Add `color_field` and `color_field_tag` helpers. *Carlos Galdino*
|
|
651
1034
|
|
|
652
|
-
*
|
|
653
|
-
|
|
1035
|
+
* `assert_generates`, `assert_recognizes`, and `assert_routing` all raise
|
|
1036
|
+
`Assertion` instead of `RoutingError` *David Chelimsky*
|
|
654
1037
|
|
|
655
|
-
*
|
|
1038
|
+
* URL path parameters with invalid encoding now raise `ActionController::BadRequest`. *Andrew White*
|
|
656
1039
|
|
|
657
|
-
*
|
|
1040
|
+
* Malformed query and request parameter hashes now raise `ActionController::BadRequest`. *Andrew White*
|
|
658
1041
|
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
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
|
-
|
|
664
|
-
end
|
|
1046
|
+
* Add `time_field` and `time_field_tag` helpers which render an `input[type="time"]` tag. *Alex Soulim*
|
|
665
1047
|
|
|
666
|
-
|
|
1048
|
+
* Removed old text helper apis from `highlight`, `excerpt` and `word_wrap`. *Jeremy Walker*
|
|
667
1049
|
|
|
668
|
-
|
|
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
|
-
*
|
|
1053
|
+
* Deprecate `:disable_with` in favor of `data: { disable_with: "Text" }` option from `submit_tag`, `button_tag` and `button_to` helpers.
|
|
671
1054
|
|
|
672
|
-
|
|
1055
|
+
*Carlos Galdino + Rafael Mendonça França*
|
|
673
1056
|
|
|
674
|
-
|
|
675
|
-
layout 'single_car', :only => :show
|
|
676
|
-
end
|
|
1057
|
+
* Remove `:mouseover` option from `image_tag` helper. *Rafael Mendonça França*
|
|
677
1058
|
|
|
678
|
-
|
|
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
|
-
*
|
|
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
|
-
|
|
1065
|
+
*Andrew White*
|
|
683
1066
|
|
|
684
|
-
|
|
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
|
-
|
|
1071
|
+
* Allows `assert_redirected_to` to match against a regular expression. *Andy Lindeman*
|
|
687
1072
|
|
|
688
|
-
|
|
1073
|
+
* Add backtrace to development routing error page. *Richard Schneeman*
|
|
689
1074
|
|
|
690
|
-
|
|
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
|
-
*
|
|
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
|
-
*
|
|
1081
|
+
* JSONP now uses mimetype `text/javascript` instead of `application/json`. *omjokine*
|
|
695
1082
|
|
|
696
|
-
*
|
|
1083
|
+
* Allow to lazy load `default_form_builder` by passing a `String` instead of a constant. *Piotr Sarnacki*
|
|
697
1084
|
|
|
698
|
-
*
|
|
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
|
-
*
|
|
701
|
-
The namespace attribute will be prefixed with underscore on the generate HTML id. *Vasiliy Ermolovich*
|
|
1090
|
+
*Andrew White*
|
|
702
1091
|
|
|
703
|
-
|
|
1092
|
+
* In the routes DSL the `:via` option of `match` is now mandatory.
|
|
704
1093
|
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
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
|
-
*
|
|
1100
|
+
* Add `index` method to FormBuilder class. *Jorge Bejar*
|
|
711
1101
|
|
|
712
|
-
|
|
1102
|
+
* Remove the leading \n added by textarea on `assert_select`. *Santiago Pastorino*
|
|
713
1103
|
|
|
714
|
-
*
|
|
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::
|
|
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
|
-
*
|
|
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
|
-
|
|
1113
|
+
* Removed default `size` option from the `text_field`, `search_field`, `telephone_field`, `url_field`, `email_field` helpers. *Philip Arndt*
|
|
721
1114
|
|
|
722
|
-
|
|
1115
|
+
* Removed default `cols` and `rows` options from the `text_area` helper. *Philip Arndt*
|
|
723
1116
|
|
|
724
|
-
*
|
|
1117
|
+
* Adds support for layouts when rendering a partial with a given collection. *serabe*
|
|
725
1118
|
|
|
726
|
-
|
|
1119
|
+
* Allows the route helper `root` to take a string argument. For example, `root 'pages#main'`. *bcardarella*
|
|
727
1120
|
|
|
728
|
-
|
|
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
|
-
*
|
|
1123
|
+
* For resources, both PATCH and PUT are routed to the `update` action. *fxn*
|
|
732
1124
|
|
|
733
|
-
*
|
|
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
|
-
|
|
1127
|
+
class AccountsController < ApplicationController
|
|
1128
|
+
force_ssl if: :ssl_configured?
|
|
736
1129
|
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
Title: <%= item.title %>
|
|
1130
|
+
def ssl_configured?
|
|
1131
|
+
!Rails.env.development?
|
|
740
1132
|
end
|
|
741
1133
|
end
|
|
742
1134
|
|
|
743
|
-
|
|
1135
|
+
*Pat Allan*
|
|
744
1136
|
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
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
|
-
*
|
|
1206
|
+
* Deprecated `ActionController::IntegrationTest` in favour of `ActionDispatch::IntegrationTest`.
|
|
750
1207
|
|
|
751
|
-
*
|
|
1208
|
+
* Deprecated `ActionController::PerformanceTest` in favour of `ActionDispatch::PerformanceTest`.
|
|
752
1209
|
|
|
753
|
-
*
|
|
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
|
-
*
|
|
1212
|
+
* Deprecated `ActionController::Request` in favour of `ActionDispatch::Request`.
|
|
759
1213
|
|
|
760
|
-
|
|
1214
|
+
* Deprecated `ActionController::AbstractResponse` in favour of `ActionDispatch::Response`.
|
|
761
1215
|
|
|
762
|
-
|
|
763
|
-
get :index
|
|
764
|
-
assert_equal 'user@example.com', cookies[:email]
|
|
1216
|
+
* Deprecated `ActionController::Response` in favour of `ActionDispatch::Response`.
|
|
765
1217
|
|
|
766
|
-
|
|
1218
|
+
* Deprecated `ActionController::Routing` in favour of `ActionDispatch::Routing`.
|
|
767
1219
|
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
777
|
-
|
|
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-
|
|
1230
|
+
Please check [3-2-stable](https://github.com/rails/rails/blob/3-2-stable/actionpack/CHANGELOG.md) for previous changes.
|