actionpack 3.2.2 → 3.2.3.rc1
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.
- data/CHANGELOG.md +24 -1
- data/lib/abstract_controller/layouts.rb +1 -2
- data/lib/abstract_controller/rendering.rb +1 -0
- data/lib/action_controller/base.rb +0 -1
- data/lib/action_controller/metal/mime_responds.rb +3 -10
- data/lib/action_controller/metal/redirecting.rb +1 -1
- data/lib/action_controller/metal/responder.rb +11 -2
- data/lib/action_controller/metal/session_management.rb +5 -0
- data/lib/action_controller/test_case.rb +0 -6
- data/lib/action_dispatch/middleware/session/cookie_store.rb +1 -1
- data/lib/action_dispatch/middleware/static.rb +1 -0
- data/lib/action_dispatch/railtie.rb +1 -1
- data/lib/action_dispatch/routing/mapper.rb +1 -1
- data/lib/action_dispatch/routing/route_set.rb +6 -0
- data/lib/action_dispatch/testing/assertions/response.rb +1 -1
- data/lib/action_pack/version.rb +2 -2
- data/lib/action_view/helpers/date_helper.rb +4 -1
- data/lib/action_view/helpers/form_helper.rb +1 -1
- data/lib/action_view/helpers/form_tag_helper.rb +13 -2
- data/lib/action_view/renderer/partial_renderer.rb +8 -0
- data/lib/action_view/renderer/template_renderer.rb +7 -2
- data/lib/sprockets/helpers/rails_helper.rb +1 -1
- metadata +69 -59
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,26 @@
|
|
1
|
-
## Rails 3.2.
|
1
|
+
## Rails 3.2.3 (unreleased) ##
|
2
|
+
|
3
|
+
* Do not include the authenticity token in forms where remote: true as ajax forms use the meta-tag value *DHH*
|
4
|
+
|
5
|
+
* Turn off verbose mode of rack-cache, we still have X-Rack-Cache to
|
6
|
+
check that info. Closes #5245. *Santiago Pastorino*
|
7
|
+
|
8
|
+
* Fix #5238, rendered_format is not set when template is not rendered. *Piotr Sarnacki*
|
9
|
+
|
10
|
+
* Upgrade rack-cache to 1.2. *José Valim*
|
11
|
+
|
12
|
+
* ActionController::SessionManagement is deprecated. *Santiago Pastorino*
|
13
|
+
|
14
|
+
* Since the router holds references to many parts of the system like engines, controllers and the application itself, inspecting the route set can actually be really slow, therefore we default alias inspect to to_s. *José Valim*
|
15
|
+
|
16
|
+
* Add a new line after the textarea opening tag. Closes #393 *Rafael Mendonça França*
|
17
|
+
|
18
|
+
* Always pass a respond block from to responder. We should let the responder to decide what to do with the given overridden response block, and not short circuit it. *sikachu*
|
19
|
+
|
20
|
+
* Fixes layout rendering regression from 3.2.2. *José Valim*
|
21
|
+
|
22
|
+
|
23
|
+
## Rails 3.2.2 (March 1, 2012) ##
|
2
24
|
|
3
25
|
* Format lookup for partials is derived from the format in which the template is being rendered. Closes #5025 part 2 *Santiago Pastorino*
|
4
26
|
|
@@ -10,6 +32,7 @@
|
|
10
32
|
This is a behavior change, previously the hidden tag had a value of the disabled checkbox.
|
11
33
|
*Tadas Tamosauskas*
|
12
34
|
|
35
|
+
|
13
36
|
## Rails 3.2.1 (January 26, 2012) ##
|
14
37
|
|
15
38
|
* Documentation improvements.
|
@@ -237,8 +237,7 @@ module AbstractController
|
|
237
237
|
#
|
238
238
|
# If the specified layout is a:
|
239
239
|
# String:: the String is the template name
|
240
|
-
# Symbol:: call the method specified by the symbol, which will return
|
241
|
-
# the template name
|
240
|
+
# Symbol:: call the method specified by the symbol, which will return the template name
|
242
241
|
# false:: There is no layout
|
243
242
|
# true:: raise an ArgumentError
|
244
243
|
# nil:: Force default layout behavior with inheritance
|
@@ -106,6 +106,7 @@ module AbstractController
|
|
106
106
|
# Find and renders a template based on the options given.
|
107
107
|
# :api: private
|
108
108
|
def _render_template(options) #:nodoc:
|
109
|
+
lookup_context.rendered_format = nil if options[:formats]
|
109
110
|
view_renderer.render(view_context, options)
|
110
111
|
end
|
111
112
|
|
@@ -235,16 +235,8 @@ module ActionController #:nodoc:
|
|
235
235
|
|
236
236
|
if collector = retrieve_collector_from_mimes(&block)
|
237
237
|
options = resources.size == 1 ? {} : resources.extract_options!
|
238
|
-
|
239
|
-
|
240
|
-
if action = options.delete(:action)
|
241
|
-
render :action => action
|
242
|
-
else
|
243
|
-
defined_response.call
|
244
|
-
end
|
245
|
-
else
|
246
|
-
(options.delete(:responder) || self.class.responder).call(self, resources, options)
|
247
|
-
end
|
238
|
+
options[:default_response] = collector.response
|
239
|
+
(options.delete(:responder) || self.class.responder).call(self, resources, options)
|
248
240
|
end
|
249
241
|
end
|
250
242
|
|
@@ -281,6 +273,7 @@ module ActionController #:nodoc:
|
|
281
273
|
if format
|
282
274
|
self.content_type ||= format.to_s
|
283
275
|
lookup_context.formats = [format.to_sym]
|
276
|
+
lookup_context.rendered_format = lookup_context.formats.first
|
284
277
|
collector
|
285
278
|
else
|
286
279
|
head :not_acceptable
|
@@ -129,6 +129,7 @@ module ActionController #:nodoc:
|
|
129
129
|
@resources = resources
|
130
130
|
@options = options
|
131
131
|
@action = options.delete(:action)
|
132
|
+
@default_response = options.delete(:default_response)
|
132
133
|
end
|
133
134
|
|
134
135
|
delegate :head, :render, :redirect_to, :to => :controller
|
@@ -171,7 +172,7 @@ module ActionController #:nodoc:
|
|
171
172
|
# responds to :to_format and display it.
|
172
173
|
#
|
173
174
|
def to_format
|
174
|
-
if get? || !has_errors?
|
175
|
+
if get? || !has_errors? || response_overridden?
|
175
176
|
default_render
|
176
177
|
else
|
177
178
|
display_errors
|
@@ -225,7 +226,11 @@ module ActionController #:nodoc:
|
|
225
226
|
# controller.
|
226
227
|
#
|
227
228
|
def default_render
|
228
|
-
|
229
|
+
if @default_response
|
230
|
+
@default_response.call(options)
|
231
|
+
else
|
232
|
+
controller.default_render(options)
|
233
|
+
end
|
229
234
|
end
|
230
235
|
|
231
236
|
# Display is just a shortcut to render a resource with the current format.
|
@@ -273,5 +278,9 @@ module ActionController #:nodoc:
|
|
273
278
|
def json_resource_errors
|
274
279
|
{:errors => resource.errors}
|
275
280
|
end
|
281
|
+
|
282
|
+
def response_overridden?
|
283
|
+
@default_response.present?
|
284
|
+
end
|
276
285
|
end
|
277
286
|
end
|
@@ -2,6 +2,11 @@ module ActionController #:nodoc:
|
|
2
2
|
module SessionManagement #:nodoc:
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
|
+
included do
|
6
|
+
ActiveSupport::Deprecation.warn "ActionController::SessionManagement " \
|
7
|
+
"is deprecated because it has no contents since Rails 3.1", caller
|
8
|
+
end
|
9
|
+
|
5
10
|
module ClassMethods
|
6
11
|
|
7
12
|
end
|
@@ -457,7 +457,6 @@ module ActionController
|
|
457
457
|
@request.session["flash"].sweep
|
458
458
|
|
459
459
|
@controller.request = @request
|
460
|
-
@controller.params.merge!(parameters)
|
461
460
|
build_request_uri(action, parameters)
|
462
461
|
@controller.class.class_eval { include Testing }
|
463
462
|
@controller.recycle!
|
@@ -483,11 +482,6 @@ module ActionController
|
|
483
482
|
end
|
484
483
|
end
|
485
484
|
|
486
|
-
# Cause the action to be rescued according to the regular rules for rescue_action when the visitor is not local
|
487
|
-
def rescue_action_in_public!
|
488
|
-
@request.remote_addr = '208.77.188.166' # example.com
|
489
|
-
end
|
490
|
-
|
491
485
|
included do
|
492
486
|
include ActionController::TemplateAssertions
|
493
487
|
include ActionDispatch::Assertions
|
@@ -325,7 +325,7 @@ module ActionDispatch
|
|
325
325
|
# +call+ or a string representing a controller's action.
|
326
326
|
#
|
327
327
|
# match 'path', :to => 'controller#action'
|
328
|
-
# match 'path', :to => lambda { [200, {}, "Success!"] }
|
328
|
+
# match 'path', :to => lambda { |env| [200, {}, "Success!"] }
|
329
329
|
# match 'path', :to => RackApp
|
330
330
|
#
|
331
331
|
# [:on]
|
@@ -9,6 +9,12 @@ require 'action_controller/metal/exceptions'
|
|
9
9
|
module ActionDispatch
|
10
10
|
module Routing
|
11
11
|
class RouteSet #:nodoc:
|
12
|
+
# Since the router holds references to many parts of the system
|
13
|
+
# like engines, controllers and the application itself, inspecting
|
14
|
+
# the route set can actually be really slow, therefore we default
|
15
|
+
# alias inspect to to_s.
|
16
|
+
alias inspect to_s
|
17
|
+
|
12
18
|
PARAMETERS_KEY = 'action_dispatch.request.path_parameters'
|
13
19
|
|
14
20
|
class Dispatcher #:nodoc:
|
data/lib/action_pack/version.rb
CHANGED
@@ -940,7 +940,10 @@ module ActionView
|
|
940
940
|
# Returns the id attribute for the input tag.
|
941
941
|
# => "post_written_on_1i"
|
942
942
|
def input_id_from_type(type)
|
943
|
-
input_name_from_type(type).gsub(/([\[\(])|(\]\[)/, '_').gsub(/[\]\)]/, '')
|
943
|
+
id = input_name_from_type(type).gsub(/([\[\(])|(\]\[)/, '_').gsub(/[\]\)]/, '')
|
944
|
+
id = @options[:namespace] + '_' + id if @options[:namespace]
|
945
|
+
|
946
|
+
id
|
944
947
|
end
|
945
948
|
|
946
949
|
# Given an ordering of datetime components, create the selection HTML
|
@@ -1072,7 +1072,7 @@ module ActionView
|
|
1072
1072
|
options["cols"], options["rows"] = size.split("x") if size.respond_to?(:split)
|
1073
1073
|
end
|
1074
1074
|
|
1075
|
-
content_tag("textarea",
|
1075
|
+
content_tag("textarea", "\n#{options.delete('value') || value_before_type_cast(object)}", options)
|
1076
1076
|
end
|
1077
1077
|
|
1078
1078
|
def to_check_box_tag(options = {}, checked_value = "1", unchecked_value = "0")
|
@@ -27,7 +27,9 @@ module ActionView
|
|
27
27
|
# is added to simulate the verb over post.
|
28
28
|
# * <tt>:authenticity_token</tt> - Authenticity token to use in the form. Use only if you need to
|
29
29
|
# pass custom authenticity token string, or to not add authenticity_token field at all
|
30
|
-
# (by passing <tt>false</tt>).
|
30
|
+
# (by passing <tt>false</tt>). If this is a remote form, the authenticity_token will by default
|
31
|
+
# not be included as the ajax handler will get it from the meta-tag (but you can force it to be
|
32
|
+
# rendered anyway in that case by passing <tt>true</tt>).
|
31
33
|
# * A list of parameters to feed to the URL the form will be posted to.
|
32
34
|
# * <tt>:remote</tt> - If set to true, will allow the Unobtrusive JavaScript drivers to control the
|
33
35
|
# submit behavior. By default this behavior is an ajax submit.
|
@@ -609,8 +611,17 @@ module ActionView
|
|
609
611
|
# responsibility of the caller to escape all the values.
|
610
612
|
html_options["action"] = url_for(url_for_options)
|
611
613
|
html_options["accept-charset"] = "UTF-8"
|
614
|
+
|
612
615
|
html_options["data-remote"] = true if html_options.delete("remote")
|
613
|
-
|
616
|
+
|
617
|
+
if html_options["data-remote"] && html_options["authenticity_token"] == true
|
618
|
+
# Include the default authenticity_token, which is only generated when its set to nil,
|
619
|
+
# but we needed the true value to override the default of no authenticity_token on data-remote.
|
620
|
+
html_options["authenticity_token"] = nil
|
621
|
+
elsif html_options["data-remote"]
|
622
|
+
# The authenticity token is taken from the meta tag in this case
|
623
|
+
html_options["authenticity_token"] = false
|
624
|
+
end
|
614
625
|
end
|
615
626
|
end
|
616
627
|
|
@@ -221,6 +221,14 @@ module ActionView
|
|
221
221
|
setup(context, options, block)
|
222
222
|
identifier = (@template = find_partial) ? @template.identifier : @path
|
223
223
|
|
224
|
+
@lookup_context.rendered_format ||= begin
|
225
|
+
if @template && @template.formats.present?
|
226
|
+
@template.formats.first
|
227
|
+
else
|
228
|
+
formats.first
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
224
232
|
if @collection
|
225
233
|
instrument(:collection, :identifier => identifier || "collection", :count => @collection.size) do
|
226
234
|
render_collection
|
@@ -8,8 +8,13 @@ module ActionView
|
|
8
8
|
@details = extract_details(options)
|
9
9
|
extract_format(options[:file] || options[:template], @details)
|
10
10
|
template = determine_template(options)
|
11
|
-
@lookup_context
|
12
|
-
|
11
|
+
context = @lookup_context
|
12
|
+
|
13
|
+
unless context.rendered_format
|
14
|
+
context.rendered_format = template.formats.first
|
15
|
+
context.formats = template.formats
|
16
|
+
end
|
17
|
+
|
13
18
|
render_template(template, options[:layout], options[:locals])
|
14
19
|
end
|
15
20
|
|
metadata
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionpack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 15424079
|
5
|
+
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
|
9
|
+
- 3
|
10
|
+
- rc
|
11
|
+
- 1
|
12
|
+
version: 3.2.3.rc1
|
11
13
|
platform: ruby
|
12
14
|
authors:
|
13
15
|
- David Heinemeier Hansson
|
@@ -15,59 +17,62 @@ autorequire:
|
|
15
17
|
bindir: bin
|
16
18
|
cert_chain: []
|
17
19
|
|
18
|
-
date: 2012-03-
|
20
|
+
date: 2012-03-27 00:00:00 -03:00
|
21
|
+
default_executable:
|
19
22
|
dependencies:
|
20
23
|
- !ruby/object:Gem::Dependency
|
21
|
-
|
22
|
-
prerelease: false
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
24
25
|
none: false
|
25
26
|
requirements:
|
26
27
|
- - "="
|
27
28
|
- !ruby/object:Gem::Version
|
28
|
-
hash:
|
29
|
+
hash: 15424079
|
29
30
|
segments:
|
30
31
|
- 3
|
31
32
|
- 2
|
32
|
-
-
|
33
|
-
|
33
|
+
- 3
|
34
|
+
- rc
|
35
|
+
- 1
|
36
|
+
version: 3.2.3.rc1
|
37
|
+
requirement: *id001
|
34
38
|
type: :runtime
|
35
|
-
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: activemodel
|
39
|
+
name: activesupport
|
38
40
|
prerelease: false
|
39
|
-
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
40
43
|
none: false
|
41
44
|
requirements:
|
42
45
|
- - "="
|
43
46
|
- !ruby/object:Gem::Version
|
44
|
-
hash:
|
47
|
+
hash: 15424079
|
45
48
|
segments:
|
46
49
|
- 3
|
47
50
|
- 2
|
48
|
-
-
|
49
|
-
|
51
|
+
- 3
|
52
|
+
- rc
|
53
|
+
- 1
|
54
|
+
version: 3.2.3.rc1
|
55
|
+
requirement: *id002
|
50
56
|
type: :runtime
|
51
|
-
|
52
|
-
- !ruby/object:Gem::Dependency
|
53
|
-
name: rack-cache
|
57
|
+
name: activemodel
|
54
58
|
prerelease: false
|
55
|
-
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
56
61
|
none: false
|
57
62
|
requirements:
|
58
63
|
- - ~>
|
59
64
|
- !ruby/object:Gem::Version
|
60
|
-
hash:
|
65
|
+
hash: 11
|
61
66
|
segments:
|
62
67
|
- 1
|
63
|
-
-
|
64
|
-
version: "1.
|
68
|
+
- 2
|
69
|
+
version: "1.2"
|
70
|
+
requirement: *id003
|
65
71
|
type: :runtime
|
66
|
-
|
67
|
-
- !ruby/object:Gem::Dependency
|
68
|
-
name: builder
|
72
|
+
name: rack-cache
|
69
73
|
prerelease: false
|
70
|
-
|
74
|
+
- !ruby/object:Gem::Dependency
|
75
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
71
76
|
none: false
|
72
77
|
requirements:
|
73
78
|
- - ~>
|
@@ -78,12 +83,12 @@ dependencies:
|
|
78
83
|
- 0
|
79
84
|
- 0
|
80
85
|
version: 3.0.0
|
86
|
+
requirement: *id004
|
81
87
|
type: :runtime
|
82
|
-
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: rack
|
88
|
+
name: builder
|
85
89
|
prerelease: false
|
86
|
-
|
90
|
+
- !ruby/object:Gem::Dependency
|
91
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
87
92
|
none: false
|
88
93
|
requirements:
|
89
94
|
- - ~>
|
@@ -94,12 +99,12 @@ dependencies:
|
|
94
99
|
- 4
|
95
100
|
- 0
|
96
101
|
version: 1.4.0
|
102
|
+
requirement: *id005
|
97
103
|
type: :runtime
|
98
|
-
|
99
|
-
- !ruby/object:Gem::Dependency
|
100
|
-
name: rack-test
|
104
|
+
name: rack
|
101
105
|
prerelease: false
|
102
|
-
|
106
|
+
- !ruby/object:Gem::Dependency
|
107
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
103
108
|
none: false
|
104
109
|
requirements:
|
105
110
|
- - ~>
|
@@ -110,12 +115,12 @@ dependencies:
|
|
110
115
|
- 6
|
111
116
|
- 1
|
112
117
|
version: 0.6.1
|
118
|
+
requirement: *id006
|
113
119
|
type: :runtime
|
114
|
-
|
115
|
-
- !ruby/object:Gem::Dependency
|
116
|
-
name: journey
|
120
|
+
name: rack-test
|
117
121
|
prerelease: false
|
118
|
-
|
122
|
+
- !ruby/object:Gem::Dependency
|
123
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
119
124
|
none: false
|
120
125
|
requirements:
|
121
126
|
- - ~>
|
@@ -126,12 +131,12 @@ dependencies:
|
|
126
131
|
- 0
|
127
132
|
- 1
|
128
133
|
version: 1.0.1
|
134
|
+
requirement: *id007
|
129
135
|
type: :runtime
|
130
|
-
|
131
|
-
- !ruby/object:Gem::Dependency
|
132
|
-
name: sprockets
|
136
|
+
name: journey
|
133
137
|
prerelease: false
|
134
|
-
|
138
|
+
- !ruby/object:Gem::Dependency
|
139
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
135
140
|
none: false
|
136
141
|
requirements:
|
137
142
|
- - ~>
|
@@ -142,12 +147,12 @@ dependencies:
|
|
142
147
|
- 1
|
143
148
|
- 2
|
144
149
|
version: 2.1.2
|
150
|
+
requirement: *id008
|
145
151
|
type: :runtime
|
146
|
-
|
147
|
-
- !ruby/object:Gem::Dependency
|
148
|
-
name: erubis
|
152
|
+
name: sprockets
|
149
153
|
prerelease: false
|
150
|
-
|
154
|
+
- !ruby/object:Gem::Dependency
|
155
|
+
version_requirements: &id009 !ruby/object:Gem::Requirement
|
151
156
|
none: false
|
152
157
|
requirements:
|
153
158
|
- - ~>
|
@@ -158,12 +163,12 @@ dependencies:
|
|
158
163
|
- 7
|
159
164
|
- 0
|
160
165
|
version: 2.7.0
|
166
|
+
requirement: *id009
|
161
167
|
type: :runtime
|
162
|
-
|
163
|
-
- !ruby/object:Gem::Dependency
|
164
|
-
name: tzinfo
|
168
|
+
name: erubis
|
165
169
|
prerelease: false
|
166
|
-
|
170
|
+
- !ruby/object:Gem::Dependency
|
171
|
+
version_requirements: &id010 !ruby/object:Gem::Requirement
|
167
172
|
none: false
|
168
173
|
requirements:
|
169
174
|
- - ~>
|
@@ -174,8 +179,10 @@ dependencies:
|
|
174
179
|
- 3
|
175
180
|
- 29
|
176
181
|
version: 0.3.29
|
182
|
+
requirement: *id010
|
177
183
|
type: :development
|
178
|
-
|
184
|
+
name: tzinfo
|
185
|
+
prerelease: false
|
179
186
|
description: Web apps on Rails. Simple, battle-tested conventions for building and testing MVC web applications. Works with any Rack-compatible server.
|
180
187
|
email: david@loudthinking.com
|
181
188
|
executables: []
|
@@ -376,6 +383,7 @@ files:
|
|
376
383
|
- lib/sprockets/helpers.rb
|
377
384
|
- lib/sprockets/railtie.rb
|
378
385
|
- lib/sprockets/static_compiler.rb
|
386
|
+
has_rdoc: true
|
379
387
|
homepage: http://www.rubyonrails.org
|
380
388
|
licenses: []
|
381
389
|
|
@@ -398,16 +406,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
398
406
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
399
407
|
none: false
|
400
408
|
requirements:
|
401
|
-
- - "
|
409
|
+
- - ">"
|
402
410
|
- !ruby/object:Gem::Version
|
403
|
-
hash:
|
411
|
+
hash: 25
|
404
412
|
segments:
|
405
|
-
-
|
406
|
-
|
413
|
+
- 1
|
414
|
+
- 3
|
415
|
+
- 1
|
416
|
+
version: 1.3.1
|
407
417
|
requirements:
|
408
418
|
- none
|
409
419
|
rubyforge_project:
|
410
|
-
rubygems_version: 1.
|
420
|
+
rubygems_version: 1.3.7
|
411
421
|
signing_key:
|
412
422
|
specification_version: 3
|
413
423
|
summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).
|