actionpack 5.0.7.2 → 5.1.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.
- checksums.yaml +5 -5
- data/CHANGELOG.md +189 -1002
- data/MIT-LICENSE +1 -1
- data/README.rdoc +1 -1
- data/lib/abstract_controller.rb +3 -3
- data/lib/abstract_controller/base.rb +10 -12
- data/lib/abstract_controller/caching.rb +6 -3
- data/lib/abstract_controller/caching/fragments.rb +1 -1
- data/lib/abstract_controller/callbacks.rb +2 -43
- data/lib/abstract_controller/collector.rb +2 -2
- data/lib/abstract_controller/helpers.rb +19 -19
- data/lib/abstract_controller/rendering.rb +9 -11
- data/lib/abstract_controller/translation.rb +3 -3
- data/lib/action_controller.rb +15 -13
- data/lib/action_controller/api.rb +3 -3
- data/lib/action_controller/base.rb +7 -12
- data/lib/action_controller/caching.rb +1 -1
- data/lib/action_controller/log_subscriber.rb +2 -2
- data/lib/action_controller/metal.rb +34 -43
- data/lib/action_controller/metal/conditional_get.rb +10 -9
- data/lib/action_controller/metal/data_streaming.rb +8 -9
- data/lib/action_controller/metal/etag_with_flash.rb +16 -0
- data/lib/action_controller/metal/etag_with_template_digest.rb +15 -15
- data/lib/action_controller/metal/exceptions.rb +4 -14
- data/lib/action_controller/metal/flash.rb +1 -1
- data/lib/action_controller/metal/force_ssl.rb +6 -6
- data/lib/action_controller/metal/head.rb +13 -19
- data/lib/action_controller/metal/helpers.rb +6 -6
- data/lib/action_controller/metal/http_authentication.rb +22 -23
- data/lib/action_controller/metal/implicit_render.rb +2 -5
- data/lib/action_controller/metal/instrumentation.rb +14 -14
- data/lib/action_controller/metal/live.rb +15 -16
- data/lib/action_controller/metal/mime_responds.rb +3 -3
- data/lib/action_controller/metal/parameter_encoding.rb +49 -0
- data/lib/action_controller/metal/params_wrapper.rb +32 -32
- data/lib/action_controller/metal/redirecting.rb +8 -24
- data/lib/action_controller/metal/renderers.rb +2 -3
- data/lib/action_controller/metal/rendering.rb +50 -60
- data/lib/action_controller/metal/request_forgery_protection.rb +51 -49
- data/lib/action_controller/metal/rescue.rb +1 -1
- data/lib/action_controller/metal/streaming.rb +4 -4
- data/lib/action_controller/metal/strong_parameters.rb +117 -250
- data/lib/action_controller/metal/testing.rb +1 -1
- data/lib/action_controller/metal/url_for.rb +4 -4
- data/lib/action_controller/railtie.rb +9 -13
- data/lib/action_controller/renderer.rb +17 -16
- data/lib/action_controller/test_case.rb +75 -148
- data/lib/action_dispatch.rb +20 -19
- data/lib/action_dispatch/http/cache.rb +9 -10
- data/lib/action_dispatch/http/filter_parameters.rb +8 -8
- data/lib/action_dispatch/http/filter_redirect.rb +2 -4
- data/lib/action_dispatch/http/headers.rb +10 -10
- data/lib/action_dispatch/http/mime_negotiation.rb +17 -22
- data/lib/action_dispatch/http/mime_type.rb +27 -52
- data/lib/action_dispatch/http/parameter_filter.rb +8 -6
- data/lib/action_dispatch/http/parameters.rb +40 -17
- data/lib/action_dispatch/http/request.rb +38 -34
- data/lib/action_dispatch/http/response.rb +16 -16
- data/lib/action_dispatch/http/upload.rb +6 -10
- data/lib/action_dispatch/http/url.rb +48 -74
- data/lib/action_dispatch/journey.rb +5 -5
- data/lib/action_dispatch/journey/formatter.rb +8 -4
- data/lib/action_dispatch/journey/gtg/builder.rb +5 -5
- data/lib/action_dispatch/journey/gtg/simulator.rb +1 -1
- data/lib/action_dispatch/journey/gtg/transition_table.rb +15 -15
- data/lib/action_dispatch/journey/nfa/builder.rb +3 -3
- data/lib/action_dispatch/journey/nfa/dot.rb +2 -2
- data/lib/action_dispatch/journey/nfa/simulator.rb +1 -1
- data/lib/action_dispatch/journey/nfa/transition_table.rb +2 -2
- data/lib/action_dispatch/journey/nodes/node.rb +5 -5
- data/lib/action_dispatch/journey/parser.rb +23 -24
- data/lib/action_dispatch/journey/parser.y +3 -2
- data/lib/action_dispatch/journey/parser_extras.rb +2 -2
- data/lib/action_dispatch/journey/path/pattern.rb +10 -3
- data/lib/action_dispatch/journey/route.rb +19 -12
- data/lib/action_dispatch/journey/router.rb +19 -12
- data/lib/action_dispatch/journey/router/utils.rb +9 -9
- data/lib/action_dispatch/journey/scanner.rb +17 -15
- data/lib/action_dispatch/journey/visitors.rb +23 -23
- data/lib/action_dispatch/middleware/callbacks.rb +0 -12
- data/lib/action_dispatch/middleware/cookies.rb +39 -39
- data/lib/action_dispatch/middleware/debug_exceptions.rb +126 -112
- data/lib/action_dispatch/middleware/debug_locks.rb +8 -8
- data/lib/action_dispatch/middleware/exception_wrapper.rb +55 -55
- data/lib/action_dispatch/middleware/executor.rb +1 -1
- data/lib/action_dispatch/middleware/flash.rb +17 -16
- data/lib/action_dispatch/middleware/public_exceptions.rb +20 -20
- data/lib/action_dispatch/middleware/reloader.rb +3 -47
- data/lib/action_dispatch/middleware/remote_ip.rb +6 -8
- data/lib/action_dispatch/middleware/request_id.rb +6 -5
- data/lib/action_dispatch/middleware/session/abstract_store.rb +14 -26
- data/lib/action_dispatch/middleware/session/cache_store.rb +3 -3
- data/lib/action_dispatch/middleware/session/cookie_store.rb +35 -35
- data/lib/action_dispatch/middleware/session/mem_cache_store.rb +2 -2
- data/lib/action_dispatch/middleware/show_exceptions.rb +19 -19
- data/lib/action_dispatch/middleware/ssl.rb +9 -27
- data/lib/action_dispatch/middleware/stack.rb +7 -26
- data/lib/action_dispatch/middleware/static.rb +13 -24
- data/lib/action_dispatch/railtie.rb +9 -11
- data/lib/action_dispatch/request/session.rb +22 -22
- data/lib/action_dispatch/request/utils.rb +11 -2
- data/lib/action_dispatch/routing.rb +8 -6
- data/lib/action_dispatch/routing/inspector.rb +37 -37
- data/lib/action_dispatch/routing/mapper.rb +296 -203
- data/lib/action_dispatch/routing/polymorphic_routes.rb +160 -134
- data/lib/action_dispatch/routing/redirection.rb +27 -22
- data/lib/action_dispatch/routing/route_set.rb +206 -92
- data/lib/action_dispatch/routing/routes_proxy.rb +2 -2
- data/lib/action_dispatch/routing/url_for.rb +14 -12
- data/lib/action_dispatch/system_test_case.rb +119 -0
- data/lib/action_dispatch/system_testing/browser.rb +28 -0
- data/lib/action_dispatch/system_testing/driver.rb +18 -0
- data/lib/action_dispatch/system_testing/server.rb +32 -0
- data/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb +61 -0
- data/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +20 -0
- data/lib/action_dispatch/testing/assertion_response.rb +6 -6
- data/lib/action_dispatch/testing/assertions.rb +4 -4
- data/lib/action_dispatch/testing/assertions/response.rb +8 -3
- data/lib/action_dispatch/testing/assertions/routing.rb +11 -11
- data/lib/action_dispatch/testing/integration.rb +47 -138
- data/lib/action_dispatch/testing/test_process.rb +2 -2
- data/lib/action_dispatch/testing/test_request.rb +16 -16
- data/lib/action_dispatch/testing/test_response.rb +1 -1
- data/lib/action_pack.rb +2 -2
- data/lib/action_pack/gem_version.rb +3 -3
- data/lib/action_pack/version.rb +1 -1
- metadata +20 -12
- data/lib/action_dispatch/middleware/params_parser.rb +0 -46
data/MIT-LICENSE
CHANGED
data/README.rdoc
CHANGED
@@ -32,7 +32,7 @@ The latest version of Action Pack can be installed with RubyGems:
|
|
32
32
|
|
33
33
|
Source code can be downloaded as part of the Rails project on GitHub
|
34
34
|
|
35
|
-
* https://github.com/rails/rails/tree/
|
35
|
+
* https://github.com/rails/rails/tree/master/actionpack
|
36
36
|
|
37
37
|
|
38
38
|
== License
|
data/lib/abstract_controller.rb
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require 'active_support/core_ext/module/attr_internal'
|
1
|
+
require "abstract_controller/error"
|
2
|
+
require "active_support/configurable"
|
3
|
+
require "active_support/descendants_tracker"
|
4
|
+
require "active_support/core_ext/module/anonymous"
|
5
|
+
require "active_support/core_ext/module/attr_internal"
|
7
6
|
|
8
7
|
module AbstractController
|
9
8
|
# Raised when a non-existing controller action is triggered.
|
@@ -22,7 +21,6 @@ module AbstractController
|
|
22
21
|
include ActiveSupport::Configurable
|
23
22
|
extend ActiveSupport::DescendantsTracker
|
24
23
|
|
25
|
-
undef_method :not_implemented
|
26
24
|
class << self
|
27
25
|
attr_reader :abstract
|
28
26
|
alias_method :abstract?, :abstract
|
@@ -94,7 +92,7 @@ module AbstractController
|
|
94
92
|
# ==== Returns
|
95
93
|
# * <tt>String</tt>
|
96
94
|
def controller_path
|
97
|
-
@controller_path ||= name.sub(/Controller$/,
|
95
|
+
@controller_path ||= name.sub(/Controller$/, "".freeze).underscore unless anonymous?
|
98
96
|
end
|
99
97
|
|
100
98
|
# Refresh the cached action_methods when a new action_method is added.
|
@@ -215,7 +213,7 @@ module AbstractController
|
|
215
213
|
# ==== Returns
|
216
214
|
# * <tt>string</tt> - The name of the method that handles the action
|
217
215
|
# * false - No valid method name could be found.
|
218
|
-
# Raise AbstractController::ActionNotFound
|
216
|
+
# Raise +AbstractController::ActionNotFound+.
|
219
217
|
def _find_action_name(action_name)
|
220
218
|
_valid_action_name?(action_name) && method_for_action(action_name)
|
221
219
|
end
|
@@ -231,11 +229,11 @@ module AbstractController
|
|
231
229
|
# with a template matching the action name is considered to exist.
|
232
230
|
#
|
233
231
|
# If you override this method to handle additional cases, you may
|
234
|
-
# also provide a method (like _handle_method_missing) to handle
|
232
|
+
# also provide a method (like +_handle_method_missing+) to handle
|
235
233
|
# the case.
|
236
234
|
#
|
237
|
-
# If none of these conditions are true, and method_for_action
|
238
|
-
# returns nil
|
235
|
+
# If none of these conditions are true, and +method_for_action+
|
236
|
+
# returns +nil+, an +AbstractController::ActionNotFound+ exception will be raised.
|
239
237
|
#
|
240
238
|
# ==== Parameters
|
241
239
|
# * <tt>action_name</tt> - An action name to find a method name for
|
@@ -29,11 +29,14 @@ module AbstractController
|
|
29
29
|
extend ConfigMethods
|
30
30
|
|
31
31
|
config_accessor :default_static_extension
|
32
|
-
self.default_static_extension ||=
|
32
|
+
self.default_static_extension ||= ".html"
|
33
33
|
|
34
34
|
config_accessor :perform_caching
|
35
35
|
self.perform_caching = true if perform_caching.nil?
|
36
36
|
|
37
|
+
config_accessor :enable_fragment_cache_logging
|
38
|
+
self.enable_fragment_cache_logging = false
|
39
|
+
|
37
40
|
class_attribute :_view_cache_dependencies
|
38
41
|
self._view_cache_dependencies = []
|
39
42
|
helper_method :view_cache_dependencies if respond_to?(:helper_method)
|
@@ -49,9 +52,9 @@ module AbstractController
|
|
49
52
|
self.class._view_cache_dependencies.map { |dep| instance_exec(&dep) }.compact
|
50
53
|
end
|
51
54
|
|
52
|
-
|
55
|
+
private
|
53
56
|
# Convenience accessor.
|
54
|
-
def cache(key, options = {}, &block)
|
57
|
+
def cache(key, options = {}, &block) # :doc:
|
55
58
|
if cache_configured?
|
56
59
|
cache_store.fetch(ActiveSupport::Cache.expand_cache_key(key, :controller), options, &block)
|
57
60
|
else
|
@@ -49,32 +49,11 @@ module AbstractController
|
|
49
49
|
def _normalize_callback_option(options, from, to) # :nodoc:
|
50
50
|
if from = options[from]
|
51
51
|
_from = Array(from).map(&:to_s).to_set
|
52
|
-
from = proc {|c| _from.include? c.action_name }
|
52
|
+
from = proc { |c| _from.include? c.action_name }
|
53
53
|
options[to] = Array(options[to]).unshift(from)
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
# Skip before, after, and around action callbacks matching any of the names.
|
58
|
-
#
|
59
|
-
# ==== Parameters
|
60
|
-
# * <tt>names</tt> - A list of valid names that could be used for
|
61
|
-
# callbacks. Note that skipping uses Ruby equality, so it's
|
62
|
-
# impossible to skip a callback defined using an anonymous proc
|
63
|
-
# using #skip_action_callback.
|
64
|
-
def skip_action_callback(*names)
|
65
|
-
ActiveSupport::Deprecation.warn('`skip_action_callback` is deprecated and will be removed in Rails 5.1. Please use skip_before_action, skip_after_action or skip_around_action instead.')
|
66
|
-
skip_before_action(*names, raise: false)
|
67
|
-
skip_after_action(*names, raise: false)
|
68
|
-
skip_around_action(*names, raise: false)
|
69
|
-
end
|
70
|
-
|
71
|
-
def skip_filter(*names)
|
72
|
-
ActiveSupport::Deprecation.warn("`skip_filter` is deprecated and will be removed in Rails 5.1. Use skip_before_action, skip_after_action or skip_around_action instead.")
|
73
|
-
skip_before_action(*names, raise: false)
|
74
|
-
skip_after_action(*names, raise: false)
|
75
|
-
skip_around_action(*names, raise: false)
|
76
|
-
end
|
77
|
-
|
78
57
|
# Take callback names and an optional callback proc, normalize them,
|
79
58
|
# then call the block with each callback. This allows us to abstract
|
80
59
|
# the normalization across several methods that use it.
|
@@ -189,22 +168,12 @@ module AbstractController
|
|
189
168
|
end
|
190
169
|
end
|
191
170
|
|
192
|
-
define_method "#{callback}_filter" do |*names, &blk|
|
193
|
-
ActiveSupport::Deprecation.warn("#{callback}_filter is deprecated and will be removed in Rails 5.1. Use #{callback}_action instead.")
|
194
|
-
send("#{callback}_action", *names, &blk)
|
195
|
-
end
|
196
|
-
|
197
171
|
define_method "prepend_#{callback}_action" do |*names, &blk|
|
198
172
|
_insert_callbacks(names, blk) do |name, options|
|
199
|
-
set_callback(:process_action, callback, name, options.merge(:
|
173
|
+
set_callback(:process_action, callback, name, options.merge(prepend: true))
|
200
174
|
end
|
201
175
|
end
|
202
176
|
|
203
|
-
define_method "prepend_#{callback}_filter" do |*names, &blk|
|
204
|
-
ActiveSupport::Deprecation.warn("prepend_#{callback}_filter is deprecated and will be removed in Rails 5.1. Use prepend_#{callback}_action instead.")
|
205
|
-
send("prepend_#{callback}_action", *names, &blk)
|
206
|
-
end
|
207
|
-
|
208
177
|
# Skip a before, after or around callback. See _insert_callbacks
|
209
178
|
# for details on the allowed parameters.
|
210
179
|
define_method "skip_#{callback}_action" do |*names|
|
@@ -213,18 +182,8 @@ module AbstractController
|
|
213
182
|
end
|
214
183
|
end
|
215
184
|
|
216
|
-
define_method "skip_#{callback}_filter" do |*names, &blk|
|
217
|
-
ActiveSupport::Deprecation.warn("skip_#{callback}_filter is deprecated and will be removed in Rails 5.1. Use skip_#{callback}_action instead.")
|
218
|
-
send("skip_#{callback}_action", *names, &blk)
|
219
|
-
end
|
220
|
-
|
221
185
|
# *_action is the same as append_*_action
|
222
186
|
alias_method :"append_#{callback}_action", :"#{callback}_action"
|
223
|
-
|
224
|
-
define_method "append_#{callback}_filter" do |*names, &blk|
|
225
|
-
ActiveSupport::Deprecation.warn("append_#{callback}_filter is deprecated and will be removed in Rails 5.1. Use append_#{callback}_action instead.")
|
226
|
-
send("append_#{callback}_action", *names, &blk)
|
227
|
-
end
|
228
187
|
end
|
229
188
|
end
|
230
189
|
end
|
@@ -16,10 +16,10 @@ module AbstractController
|
|
16
16
|
end
|
17
17
|
|
18
18
|
Mime::Type.register_callback do |mime|
|
19
|
-
generate_method_for_mime(mime) unless
|
19
|
+
generate_method_for_mime(mime) unless instance_methods.include?(mime.to_sym)
|
20
20
|
end
|
21
21
|
|
22
|
-
|
22
|
+
private
|
23
23
|
|
24
24
|
def method_missing(symbol, &block)
|
25
25
|
unless mime_constant = Mime[symbol]
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "active_support/dependencies"
|
2
2
|
|
3
3
|
module AbstractController
|
4
4
|
module Helpers
|
@@ -171,25 +171,25 @@ module AbstractController
|
|
171
171
|
end
|
172
172
|
|
173
173
|
private
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
174
|
+
# Makes all the (instance) methods in the helper module available to templates
|
175
|
+
# rendered through this controller.
|
176
|
+
#
|
177
|
+
# ==== Parameters
|
178
|
+
# * <tt>module</tt> - The module to include into the current helper module
|
179
|
+
# for the class
|
180
|
+
def add_template_helper(mod)
|
181
|
+
_helpers.module_eval { include mod }
|
182
|
+
end
|
183
183
|
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
184
|
+
def default_helper_module!
|
185
|
+
module_name = name.sub(/Controller$/, "".freeze)
|
186
|
+
module_path = module_name.underscore
|
187
|
+
helper module_path
|
188
|
+
rescue LoadError => e
|
189
|
+
raise e unless e.is_missing? "helpers/#{module_path}_helper"
|
190
|
+
rescue NameError => e
|
191
|
+
raise e unless e.missing_name? "#{module_name}Helper"
|
192
|
+
end
|
193
193
|
end
|
194
194
|
end
|
195
195
|
end
|
@@ -1,9 +1,7 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require 'action_view/view_paths'
|
6
|
-
require 'set'
|
1
|
+
require "abstract_controller/error"
|
2
|
+
require "action_view"
|
3
|
+
require "action_view/view_paths"
|
4
|
+
require "set"
|
7
5
|
|
8
6
|
module AbstractController
|
9
7
|
class DoubleRenderError < Error
|
@@ -80,7 +78,7 @@ module AbstractController
|
|
80
78
|
# <tt>render :action => "foo"</tt> and <tt>render "foo/bar"</tt> to
|
81
79
|
# <tt>render :file => "foo/bar"</tt>.
|
82
80
|
# :api: plugin
|
83
|
-
def _normalize_args(action=nil, options={})
|
81
|
+
def _normalize_args(action = nil, options = {})
|
84
82
|
if action.respond_to?(:permitted?)
|
85
83
|
if action.permitted?
|
86
84
|
action
|
@@ -111,6 +109,9 @@ module AbstractController
|
|
111
109
|
def _process_format(format)
|
112
110
|
end
|
113
111
|
|
112
|
+
def _process_variant(options)
|
113
|
+
end
|
114
|
+
|
114
115
|
def _set_html_content_type # :nodoc:
|
115
116
|
end
|
116
117
|
|
@@ -121,10 +122,7 @@ module AbstractController
|
|
121
122
|
# :api: private
|
122
123
|
def _normalize_render(*args, &block)
|
123
124
|
options = _normalize_args(*args, &block)
|
124
|
-
|
125
|
-
if defined?(request) && !request.nil? && request.variant.present?
|
126
|
-
options[:variant] = request.variant
|
127
|
-
end
|
125
|
+
_process_variant(options)
|
128
126
|
_normalize_options(options)
|
129
127
|
options
|
130
128
|
end
|
@@ -9,11 +9,11 @@ module AbstractController
|
|
9
9
|
# to translate many keys within the same controller / action and gives you a
|
10
10
|
# simple framework for scoping them consistently.
|
11
11
|
def translate(key, options = {})
|
12
|
-
if key.to_s.first ==
|
13
|
-
path = controller_path.tr(
|
12
|
+
if key.to_s.first == "."
|
13
|
+
path = controller_path.tr("/", ".")
|
14
14
|
defaults = [:"#{path}#{key}"]
|
15
15
|
defaults << options[:default] if options[:default]
|
16
|
-
options[:default] = defaults
|
16
|
+
options[:default] = defaults
|
17
17
|
key = "#{path}.#{action_name}#{key}"
|
18
18
|
end
|
19
19
|
I18n.translate(key, options)
|
data/lib/action_controller.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
1
|
+
require "active_support/rails"
|
2
|
+
require "abstract_controller"
|
3
|
+
require "action_dispatch"
|
4
|
+
require "action_controller/metal/live"
|
5
|
+
require "action_controller/metal/strong_parameters"
|
6
6
|
|
7
7
|
module ActionController
|
8
8
|
extend ActiveSupport::Autoload
|
@@ -23,6 +23,7 @@ module ActionController
|
|
23
23
|
autoload :Cookies
|
24
24
|
autoload :DataStreaming
|
25
25
|
autoload :EtagWithTemplateDigest
|
26
|
+
autoload :EtagWithFlash
|
26
27
|
autoload :Flash
|
27
28
|
autoload :ForceSSL
|
28
29
|
autoload :Head
|
@@ -40,6 +41,7 @@ module ActionController
|
|
40
41
|
autoload :Rescue
|
41
42
|
autoload :Streaming
|
42
43
|
autoload :StrongParameters
|
44
|
+
autoload :ParameterEncoding
|
43
45
|
autoload :Testing
|
44
46
|
autoload :UrlFor
|
45
47
|
end
|
@@ -48,14 +50,14 @@ module ActionController
|
|
48
50
|
autoload :ApiRendering
|
49
51
|
end
|
50
52
|
|
51
|
-
autoload :TestCase,
|
52
|
-
autoload :TemplateAssertions,
|
53
|
+
autoload :TestCase, "action_controller/test_case"
|
54
|
+
autoload :TemplateAssertions, "action_controller/test_case"
|
53
55
|
end
|
54
56
|
|
55
57
|
# Common Active Support usage in Action Controller
|
56
|
-
require
|
57
|
-
require
|
58
|
-
require
|
59
|
-
require
|
60
|
-
require
|
61
|
-
require
|
58
|
+
require "active_support/core_ext/module/attribute_accessors"
|
59
|
+
require "active_support/core_ext/load_error"
|
60
|
+
require "active_support/core_ext/module/attr_internal"
|
61
|
+
require "active_support/core_ext/name_error"
|
62
|
+
require "active_support/core_ext/uri"
|
63
|
+
require "active_support/inflector"
|
@@ -1,6 +1,6 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
1
|
+
require "action_view"
|
2
|
+
require "action_controller"
|
3
|
+
require "action_controller/log_subscriber"
|
4
4
|
|
5
5
|
module ActionController
|
6
6
|
# API Controller is a lightweight version of <tt>ActionController::Base</tt>,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require
|
1
|
+
require "action_view"
|
2
2
|
require "action_controller/log_subscriber"
|
3
3
|
require "action_controller/metal/params_wrapper"
|
4
4
|
|
@@ -32,7 +32,7 @@ module ActionController
|
|
32
32
|
# new post), it initiates a redirect instead. This redirect works by returning an external
|
33
33
|
# "302 Moved" HTTP response that takes the user to the index action.
|
34
34
|
#
|
35
|
-
# These two methods represent the two basic action archetypes used in Action Controllers
|
35
|
+
# These two methods represent the two basic action archetypes used in Action Controllers: Get-and-show and do-and-redirect.
|
36
36
|
# Most actions are variations on these themes.
|
37
37
|
#
|
38
38
|
# == Requests
|
@@ -51,8 +51,8 @@ module ActionController
|
|
51
51
|
# == Parameters
|
52
52
|
#
|
53
53
|
# All request parameters, whether they come from a query string in the URL or form data submitted through a POST request are
|
54
|
-
# available through the params method which returns a hash. For example, an action that was performed through
|
55
|
-
# <tt>/posts?category=All&limit=5</tt> will include <tt>{ "category" => "All", "limit" => "5" }</tt> in params
|
54
|
+
# available through the <tt>params</tt> method which returns a hash. For example, an action that was performed through
|
55
|
+
# <tt>/posts?category=All&limit=5</tt> will include <tt>{ "category" => "All", "limit" => "5" }</tt> in <tt>params</tt>.
|
56
56
|
#
|
57
57
|
# It's also possible to construct multi-dimensional parameter hashes by specifying keys using brackets, such as:
|
58
58
|
#
|
@@ -60,7 +60,7 @@ module ActionController
|
|
60
60
|
# <input type="text" name="post[address]" value="hyacintvej">
|
61
61
|
#
|
62
62
|
# A request stemming from a form holding these inputs will include <tt>{ "post" => { "name" => "david", "address" => "hyacintvej" } }</tt>.
|
63
|
-
# If the address input had been named <tt>post[address][street]</tt>, the params would have included
|
63
|
+
# If the address input had been named <tt>post[address][street]</tt>, the <tt>params</tt> would have included
|
64
64
|
# <tt>{ "post" => { "address" => { "street" => "hyacintvej" } } }</tt>. There's no limit to the depth of the nesting.
|
65
65
|
#
|
66
66
|
# == Sessions
|
@@ -213,11 +213,12 @@ module ActionController
|
|
213
213
|
Renderers::All,
|
214
214
|
ConditionalGet,
|
215
215
|
EtagWithTemplateDigest,
|
216
|
+
EtagWithFlash,
|
216
217
|
Caching,
|
217
218
|
MimeResponds,
|
218
219
|
ImplicitRender,
|
219
220
|
StrongParameters,
|
220
|
-
|
221
|
+
ParameterEncoding,
|
221
222
|
Cookies,
|
222
223
|
Flash,
|
223
224
|
FormBuilder,
|
@@ -260,12 +261,6 @@ module ActionController
|
|
260
261
|
PROTECTED_IVARS
|
261
262
|
end
|
262
263
|
|
263
|
-
def self.make_response!(request)
|
264
|
-
ActionDispatch::Response.create.tap do |res|
|
265
|
-
res.request = request
|
266
|
-
end
|
267
|
-
end
|
268
|
-
|
269
264
|
ActiveSupport.run_load_hooks(:action_controller, self)
|
270
265
|
end
|
271
266
|
end
|