actionpack 3.0.0.beta4 → 3.0.0.rc
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 +36 -0
- data/{README → README.rdoc} +79 -137
- data/lib/abstract_controller.rb +1 -0
- data/lib/abstract_controller/asset_paths.rb +1 -1
- data/lib/abstract_controller/base.rb +3 -12
- data/lib/abstract_controller/rendering.rb +2 -2
- data/lib/abstract_controller/view_paths.rb +2 -1
- data/lib/action_controller.rb +1 -2
- data/lib/action_controller/base.rb +3 -9
- data/lib/action_controller/log_subscriber.rb +56 -0
- data/lib/action_controller/metal.rb +10 -3
- data/lib/action_controller/metal/helpers.rb +5 -4
- data/lib/action_controller/metal/hide_actions.rb +3 -3
- data/lib/action_controller/metal/instrumentation.rb +2 -1
- data/lib/action_controller/metal/mime_responds.rb +13 -10
- data/lib/action_controller/metal/rack_delegation.rb +0 -4
- data/lib/action_controller/metal/request_forgery_protection.rb +1 -1
- data/lib/action_controller/metal/rescue.rb +9 -0
- data/lib/action_controller/metal/responder.rb +13 -5
- data/lib/action_controller/metal/streaming.rb +2 -0
- data/lib/action_controller/metal/url_for.rb +5 -5
- data/lib/action_controller/railtie.rb +14 -23
- data/lib/action_controller/record_identifier.rb +6 -25
- data/lib/action_controller/test_case.rb +18 -6
- data/lib/action_controller/vendor/html-scanner/html/node.rb +1 -0
- data/lib/action_controller/vendor/html-scanner/html/tokenizer.rb +1 -0
- data/lib/action_dispatch.rb +6 -0
- data/lib/action_dispatch/http/cache.rb +2 -2
- data/lib/action_dispatch/http/filter_parameters.rb +10 -66
- data/lib/action_dispatch/http/mime_type.rb +1 -1
- data/lib/action_dispatch/http/parameter_filter.rb +72 -0
- data/lib/action_dispatch/http/parameters.rb +31 -2
- data/lib/action_dispatch/http/request.rb +4 -1
- data/lib/action_dispatch/http/upload.rb +2 -2
- data/lib/action_dispatch/middleware/callbacks.rb +4 -4
- data/lib/action_dispatch/middleware/cookies.rb +39 -6
- data/lib/action_dispatch/middleware/flash.rb +9 -2
- data/lib/action_dispatch/middleware/session/abstract_store.rb +121 -36
- data/lib/action_dispatch/middleware/session/cookie_store.rb +26 -19
- data/lib/action_dispatch/middleware/session/mem_cache_store.rb +9 -1
- data/lib/action_dispatch/middleware/show_exceptions.rb +2 -2
- data/lib/action_dispatch/middleware/stack.rb +12 -5
- data/lib/action_dispatch/railtie.rb +1 -1
- data/lib/action_dispatch/routing.rb +11 -13
- data/lib/action_dispatch/routing/deprecated_mapper.rb +6 -388
- data/lib/action_dispatch/routing/mapper.rb +364 -234
- data/lib/action_dispatch/routing/polymorphic_routes.rb +186 -0
- data/lib/action_dispatch/routing/route.rb +11 -2
- data/lib/action_dispatch/routing/route_set.rb +62 -28
- data/lib/action_dispatch/routing/url_for.rb +2 -1
- data/lib/action_dispatch/testing/assertions.rb +0 -2
- data/lib/action_dispatch/testing/assertions/routing.rb +0 -1
- data/lib/action_dispatch/testing/assertions/selector.rb +20 -24
- data/lib/action_dispatch/testing/integration.rb +2 -2
- data/lib/action_dispatch/testing/test_response.rb +2 -2
- data/lib/action_pack/version.rb +1 -1
- data/lib/action_view.rb +1 -0
- data/lib/action_view/base.rb +20 -21
- data/lib/action_view/context.rb +9 -12
- data/lib/action_view/helpers.rb +0 -2
- data/lib/action_view/helpers/active_model_helper.rb +17 -2
- data/lib/action_view/helpers/asset_tag_helper.rb +15 -33
- data/lib/action_view/helpers/atom_feed_helper.rb +5 -3
- data/lib/action_view/helpers/cache_helper.rb +4 -2
- data/lib/action_view/helpers/capture_helper.rb +4 -4
- data/lib/action_view/helpers/csrf_helper.rb +3 -1
- data/lib/action_view/helpers/date_helper.rb +10 -5
- data/lib/action_view/helpers/debug_helper.rb +3 -1
- data/lib/action_view/helpers/form_helper.rb +36 -30
- data/lib/action_view/helpers/form_options_helper.rb +7 -6
- data/lib/action_view/helpers/form_tag_helper.rb +17 -6
- data/lib/action_view/helpers/javascript_helper.rb +1 -0
- data/lib/action_view/helpers/number_helper.rb +16 -45
- data/lib/action_view/helpers/prototype_helper.rb +14 -16
- data/lib/action_view/helpers/raw_output_helper.rb +9 -0
- data/lib/action_view/helpers/record_tag_helper.rb +5 -0
- data/lib/action_view/helpers/sanitize_helper.rb +26 -20
- data/lib/action_view/helpers/scriptaculous_helper.rb +6 -5
- data/lib/action_view/helpers/tag_helper.rb +2 -1
- data/lib/action_view/helpers/text_helper.rb +24 -111
- data/lib/action_view/helpers/translation_helper.rb +17 -10
- data/lib/action_view/helpers/url_helper.rb +26 -33
- data/lib/action_view/log_subscriber.rb +28 -0
- data/lib/action_view/lookup_context.rb +2 -0
- data/lib/action_view/paths.rb +1 -0
- data/lib/action_view/railtie.rb +15 -3
- data/lib/action_view/render/layouts.rb +2 -1
- data/lib/action_view/render/partials.rb +3 -1
- data/lib/action_view/render/rendering.rb +2 -1
- data/lib/action_view/template.rb +12 -8
- data/lib/action_view/template/error.rb +1 -0
- data/lib/action_view/template/handlers.rb +1 -0
- data/lib/action_view/template/resolver.rb +2 -1
- data/lib/action_view/template/text.rb +1 -0
- data/lib/action_view/test_case.rb +42 -20
- metadata +44 -23
- data/lib/action_controller/polymorphic_routes.rb +0 -182
- data/lib/action_controller/railties/log_subscriber.rb +0 -56
- data/lib/action_controller/railties/url_helpers.rb +0 -14
- data/lib/action_dispatch/testing/assertions/model.rb +0 -19
- data/lib/action_view/helpers/record_identification_helper.rb +0 -20
- data/lib/action_view/railties/log_subscriber.rb +0 -24
data/CHANGELOG
CHANGED
@@ -1,3 +1,39 @@
|
|
1
|
+
*Rails 3.0.0 [release candidate] (July 26th, 2010)*
|
2
|
+
|
3
|
+
* Allow stylesheet/javascript extensions to be changed through railties. [Josh Kalderimis]
|
4
|
+
|
5
|
+
* link_to, button_to, and tag/tag_options now rely on html_escape instead of escape_once. [fxn]
|
6
|
+
|
7
|
+
* url_for returns always unescaped strings, and the :escape option is gone. [fxn]
|
8
|
+
|
9
|
+
* Added accept-charset parameter and _snowman hidden field to force the contents
|
10
|
+
of Rails POSTed forms to be in UTF-8 [Yehuda Katz]
|
11
|
+
|
12
|
+
* Upgrade to Rack 1.2.1 [Jeremy Kemper]
|
13
|
+
|
14
|
+
* Allow :path to be given to match/get/post/put/delete instead of :path_names in the new router [Carlos Antônio da Silva]
|
15
|
+
|
16
|
+
* Added resources_path_names to the new router DSL [José Valim]
|
17
|
+
|
18
|
+
* Allow options to be given to the namespace method in the new router [Carlos Antônio da Silva]
|
19
|
+
|
20
|
+
* Deprecate :name_prefix in the new router DSL [José Valim]
|
21
|
+
|
22
|
+
* Add shallow routes back to the new router [Diego Carrion, Andrew White]
|
23
|
+
|
24
|
+
resources :posts do
|
25
|
+
shallow do
|
26
|
+
resources :comments
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
You can now use comment_path for /comments/1 instead of post_comment_path for /posts/1/comments/1.
|
31
|
+
|
32
|
+
* Add support for multi-subdomain session by setting cookie host in session cookie so you can share session between www.example.com, example.com and user.example.com. #4818 [Guillermo Álvarez]
|
33
|
+
|
34
|
+
* Removed textilize, textilize_without_paragraph and markdown helpers. [Santiago Pastorino]
|
35
|
+
|
36
|
+
|
1
37
|
*Rails 3.0.0 [beta 4] (June 8th, 2010)*
|
2
38
|
|
3
39
|
* Remove middleware laziness [José Valim]
|
data/{README → README.rdoc}
RENAMED
@@ -1,34 +1,35 @@
|
|
1
|
-
= Action Pack --
|
2
|
-
|
3
|
-
Action Pack
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
1
|
+
= Action Pack -- From request to response
|
2
|
+
|
3
|
+
Action Pack is a framework for handling and responding to web requests. It it
|
4
|
+
provides mechanisms for *routing* (mapping request URLs to actions), defining
|
5
|
+
*controllers* that implement actions, and generating responses by rendering
|
6
|
+
*views*, which are templates of various formats. In short, Action Pack
|
7
|
+
provides the view and controller layers in the MVC paradigm.
|
8
|
+
|
9
|
+
It consists of several modules:
|
10
|
+
|
11
|
+
* Action Dispatch, which parses information about the web request, handles
|
12
|
+
routing as defined by the user, and does advanced processing related to HTTP
|
13
|
+
such as MIME-type negotiation, decoding parameters in POST/PUT bodies,
|
14
|
+
handling HTTP caching logic, cookies and sessions.
|
15
|
+
|
16
|
+
* Action Controller, which provides a base controller class that can be
|
17
|
+
subclassed to implement filters and actions to handle requests. The result
|
18
|
+
of an action is typically content generated from views.
|
19
|
+
|
20
|
+
* Action View, which handles view template lookup and rendering, and provides
|
21
|
+
view helpers that assist when building HTML forms, Atom feeds and more.
|
22
|
+
Template formats that Action View handles are ERb (embedded Ruby, typically
|
23
|
+
used to inline short Ruby snippets inside HTML), XML Builder and RJS
|
24
|
+
(dynamically generated JavaScript from Ruby code).
|
25
|
+
|
26
|
+
With the Ruby on Rails framework, users only directly interface with the
|
27
|
+
Action Controller module. Necessary Action Dispatch functionality is activated
|
28
|
+
by default and Action View rendering is implicitly triggered by Action
|
29
|
+
Controller. However, these modules are designed to function on their own and
|
30
|
+
can be used outside of Rails.
|
31
|
+
|
32
|
+
A short rundown of some of the major features:
|
32
33
|
|
33
34
|
* Actions grouped in controller as methods instead of separate command objects
|
34
35
|
and can therefore share helper methods
|
@@ -40,26 +41,29 @@ A short rundown of the major features:
|
|
40
41
|
|
41
42
|
def update
|
42
43
|
@customer = find_customer
|
43
|
-
@customer.
|
44
|
-
|
45
|
-
|
46
|
-
render
|
44
|
+
if @customer.update_attributes(params[:customer])
|
45
|
+
redirect_to :action => "show"
|
46
|
+
else
|
47
|
+
render :action => "edit"
|
48
|
+
end
|
47
49
|
end
|
48
50
|
|
49
51
|
private
|
50
|
-
def find_customer
|
52
|
+
def find_customer
|
53
|
+
Customer.find params[:id]
|
54
|
+
end
|
51
55
|
end
|
52
56
|
|
53
57
|
{Learn more}[link:classes/ActionController/Base.html]
|
54
58
|
|
55
59
|
|
56
|
-
*
|
60
|
+
* ERb templates (static content mixed with dynamic output from ruby)
|
57
61
|
|
58
62
|
<% for post in @posts %>
|
59
63
|
Title: <%= post.title %>
|
60
64
|
<% end %>
|
61
65
|
|
62
|
-
All post titles: <%= @posts.collect{ |p| p.title }.join
|
66
|
+
All post titles: <%= @posts.collect{ |p| p.title }.join(", ") %>
|
63
67
|
|
64
68
|
<% unless @person.is_client? %>
|
65
69
|
Not for clients to see...
|
@@ -68,7 +72,7 @@ A short rundown of the major features:
|
|
68
72
|
{Learn more}[link:classes/ActionView.html]
|
69
73
|
|
70
74
|
|
71
|
-
* Builder
|
75
|
+
* "Builder" templates (great for XML content, like RSS)
|
72
76
|
|
73
77
|
xml.rss("version" => "2.0") do
|
74
78
|
xml.channel do
|
@@ -93,11 +97,16 @@ A short rundown of the major features:
|
|
93
97
|
{Learn more}[link:classes/ActionView/Base.html]
|
94
98
|
|
95
99
|
|
96
|
-
* Filters for pre and post
|
100
|
+
* Filters for pre- and post-processing of the response
|
97
101
|
|
98
102
|
class WeblogController < ActionController::Base
|
103
|
+
# filters as methods
|
99
104
|
before_filter :authenticate, :cache, :audit
|
105
|
+
|
106
|
+
# filter as a proc
|
100
107
|
after_filter { |c| c.response.body = Gzip::compress(c.response.body) }
|
108
|
+
|
109
|
+
# class filter
|
101
110
|
after_filter LocalizeFilter
|
102
111
|
|
103
112
|
def index
|
@@ -120,16 +129,14 @@ A short rundown of the major features:
|
|
120
129
|
|
121
130
|
* Helpers for forms, dates, action links, and text
|
122
131
|
|
123
|
-
<%=
|
124
|
-
<%= html_date_select(Date.today) %>
|
132
|
+
<%= text_field_tag "post", "title", "size" => 30 %>
|
125
133
|
<%= link_to "New post", :controller => "post", :action => "new" %>
|
126
134
|
<%= truncate(post.title, :length => 25) %>
|
127
135
|
|
128
136
|
{Learn more}[link:classes/ActionView/Helpers.html]
|
129
137
|
|
130
138
|
|
131
|
-
* Layout sharing for template reuse
|
132
|
-
Tiles[http://jakarta.apache.org/struts/userGuide/dev_tiles.html])
|
139
|
+
* Layout sharing for template reuse
|
133
140
|
|
134
141
|
class WeblogController < ActionController::Base
|
135
142
|
layout "weblog_layout"
|
@@ -150,22 +157,22 @@ A short rundown of the major features:
|
|
150
157
|
{Learn more}[link:classes/ActionController/Layout/ClassMethods.html]
|
151
158
|
|
152
159
|
|
153
|
-
* Routing makes pretty
|
160
|
+
* Routing makes pretty URLs incredibly easy
|
154
161
|
|
155
|
-
|
162
|
+
match 'clients/:client_name/:project_name/:controller/:action'
|
156
163
|
|
157
|
-
Accessing /clients/37signals/basecamp/project/
|
158
|
-
{ "client_name" => "37signals", "project_name" => "basecamp" } in params
|
164
|
+
Accessing "/clients/37signals/basecamp/project/index" calls ProjectController#index with
|
165
|
+
{ "client_name" => "37signals", "project_name" => "basecamp" } in `params`
|
159
166
|
|
160
|
-
From that
|
167
|
+
From that action, you can write the redirect in a number of ways:
|
161
168
|
|
162
169
|
redirect_to(:action => "edit") =>
|
163
|
-
/clients/37signals/basecamp/project/
|
170
|
+
/clients/37signals/basecamp/project/edit
|
164
171
|
|
165
172
|
redirect_to(:client_name => "nextangle", :project_name => "rails") =>
|
166
|
-
/clients/nextangle/rails/project/
|
173
|
+
/clients/nextangle/rails/project/index
|
167
174
|
|
168
|
-
{Learn more}[link:classes/
|
175
|
+
{Learn more}[link:classes/ActionDispatch/Routing.html]
|
169
176
|
|
170
177
|
|
171
178
|
* Easy testing of both controller and rendered template through ActionController::TestCase
|
@@ -183,20 +190,20 @@ A short rundown of the major features:
|
|
183
190
|
|
184
191
|
* Automated benchmarking and integrated logging
|
185
192
|
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
Completed in
|
193
|
+
Started GET "/weblog" for 127.0.0.1 at Fri May 28 00:41:55
|
194
|
+
Processing by WeblogController#index as HTML
|
195
|
+
Rendered weblog/index.html.erb within layouts/application (25.7ms)
|
196
|
+
Completed 200 OK in 29.3ms
|
190
197
|
|
191
198
|
If Active Record is used as the model, you'll have the database debugging
|
192
199
|
as well:
|
193
200
|
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
SQL (0.
|
201
|
+
Started POST "/posts" for 127.0.0.1 at Sat Jun 19 14:04:23
|
202
|
+
Processing by PostsController#create as HTML
|
203
|
+
Parameters: {"post"=>{"title"=>"this is good"}}
|
204
|
+
SQL (0.6ms) INSERT INTO posts (title) VALUES('this is good')
|
198
205
|
Redirected to http://example.com/posts/5
|
199
|
-
Completed in
|
206
|
+
Completed 302 Found in 221ms (Views: 215ms | ActiveRecord: 0.6ms)
|
200
207
|
|
201
208
|
You specify a logger through a class method, such as:
|
202
209
|
|
@@ -242,62 +249,6 @@ A short rundown of the major features:
|
|
242
249
|
{Learn more}[link:classes/ActionController/Rescue.html]
|
243
250
|
|
244
251
|
|
245
|
-
* Scaffolding for Active Record model objects
|
246
|
-
|
247
|
-
class AccountController < ActionController::Base
|
248
|
-
scaffold :account
|
249
|
-
end
|
250
|
-
|
251
|
-
The AccountController now has the full CRUD range of actions and default
|
252
|
-
templates: list, show, destroy, new, create, edit, update
|
253
|
-
|
254
|
-
{Learn more}[link:classes/ActionController/Scaffolding/ClassMethods.html]
|
255
|
-
|
256
|
-
|
257
|
-
* Form building for Active Record model objects
|
258
|
-
|
259
|
-
The post object has a title (varchar), content (text), and
|
260
|
-
written_on (date)
|
261
|
-
|
262
|
-
<%= form "post" %>
|
263
|
-
|
264
|
-
...will generate something like (the selects will have more options, of
|
265
|
-
course):
|
266
|
-
|
267
|
-
<form action="create" method="POST">
|
268
|
-
<p>
|
269
|
-
<b>Title:</b><br/>
|
270
|
-
<input type="text" name="post[title]" value="<%= @post.title %>" />
|
271
|
-
</p>
|
272
|
-
<p>
|
273
|
-
<b>Content:</b><br/>
|
274
|
-
<textarea name="post[content]"><%= @post.title %></textarea>
|
275
|
-
</p>
|
276
|
-
<p>
|
277
|
-
<b>Written on:</b><br/>
|
278
|
-
<select name='post[written_on(3i)]'><option>18</option></select>
|
279
|
-
<select name='post[written_on(2i)]'><option value='7'>July</option></select>
|
280
|
-
<select name='post[written_on(1i)]'><option>2004</option></select>
|
281
|
-
</p>
|
282
|
-
|
283
|
-
<input type="submit" value="Create">
|
284
|
-
</form>
|
285
|
-
|
286
|
-
This form generates a params[:post] array that can be used directly in a save action:
|
287
|
-
|
288
|
-
class WeblogController < ActionController::Base
|
289
|
-
def create
|
290
|
-
post = Post.create(params[:post])
|
291
|
-
redirect_to :action => "show", :id => post.id
|
292
|
-
end
|
293
|
-
end
|
294
|
-
|
295
|
-
{Learn more}[link:classes/ActionView/Helpers/ActiveRecordHelper.html]
|
296
|
-
|
297
|
-
|
298
|
-
* Runs on top of WEBrick, Mongrel, CGI, FCGI, and mod_ruby
|
299
|
-
|
300
|
-
|
301
252
|
== Simple example (from outside of Rails)
|
302
253
|
|
303
254
|
This example will implement a simple weblog system using inline templates and
|
@@ -364,24 +315,15 @@ new model). After creating the post, it'll redirect to the show page using
|
|
364
315
|
an URL such as /weblog/5 (where 5 is the id of the post).
|
365
316
|
|
366
317
|
|
367
|
-
== Download
|
318
|
+
== Download and installation
|
368
319
|
|
369
|
-
The latest version of Action Pack can be
|
320
|
+
The latest version of Action Pack can be installed with Rubygems:
|
370
321
|
|
371
|
-
|
322
|
+
% [sudo] gem install actionpack
|
372
323
|
|
373
|
-
|
324
|
+
Source code can be downloaded as part of the Rails project on GitHub
|
374
325
|
|
375
|
-
* http://
|
376
|
-
|
377
|
-
|
378
|
-
== Installation
|
379
|
-
|
380
|
-
You can install Action Pack with the following command.
|
381
|
-
|
382
|
-
% [sudo] ruby install.rb
|
383
|
-
|
384
|
-
from its distribution directory.
|
326
|
+
* http://github.com/rails/rails/tree/master/actionpack/
|
385
327
|
|
386
328
|
|
387
329
|
== License
|
@@ -391,10 +333,10 @@ Action Pack is released under the MIT license.
|
|
391
333
|
|
392
334
|
== Support
|
393
335
|
|
394
|
-
|
395
|
-
|
396
|
-
|
336
|
+
API documentation is at
|
337
|
+
|
338
|
+
* http://api.rubyonrails.com
|
339
|
+
|
340
|
+
Bug reports and feature requests can be filed with the rest for the Ruby on Rails project here:
|
397
341
|
|
398
|
-
|
399
|
-
remember to update the corresponding unit tests. If fact, I prefer
|
400
|
-
new feature to be submitted in the form of new unit tests.
|
342
|
+
* https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets
|
data/lib/abstract_controller.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
activesupport_path = File.expand_path('../../../activesupport/lib', __FILE__)
|
2
2
|
$:.unshift(activesupport_path) if File.directory?(activesupport_path) && !$:.include?(activesupport_path)
|
3
3
|
|
4
|
+
require 'action_pack'
|
4
5
|
require 'active_support/ruby/shim'
|
5
6
|
require 'active_support/dependencies/autoload'
|
6
7
|
require 'active_support/core_ext/class/attribute'
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'active_support/configurable'
|
2
|
+
require 'active_support/descendants_tracker'
|
2
3
|
require 'active_support/core_ext/module/anonymous'
|
3
4
|
|
4
5
|
module AbstractController
|
@@ -10,6 +11,7 @@ module AbstractController
|
|
10
11
|
attr_internal :action_name
|
11
12
|
|
12
13
|
include ActiveSupport::Configurable
|
14
|
+
extend ActiveSupport::DescendantsTracker
|
13
15
|
|
14
16
|
class << self
|
15
17
|
attr_reader :abstract
|
@@ -21,17 +23,6 @@ module AbstractController
|
|
21
23
|
@abstract = true
|
22
24
|
end
|
23
25
|
|
24
|
-
def inherited(klass)
|
25
|
-
::AbstractController::Base.descendants << klass.to_s
|
26
|
-
super
|
27
|
-
end
|
28
|
-
|
29
|
-
# A list of all descendents of AbstractController::Base. This is
|
30
|
-
# useful for initializers which need to add behavior to all controllers.
|
31
|
-
def descendants
|
32
|
-
@descendants ||= []
|
33
|
-
end
|
34
|
-
|
35
26
|
# A list of all internal methods for a controller. This finds the first
|
36
27
|
# abstract superclass of a controller, and gets a list of all public
|
37
28
|
# instance methods on that abstract class. Public instance methods of
|
@@ -106,7 +97,7 @@ module AbstractController
|
|
106
97
|
@_action_name = action_name = action.to_s
|
107
98
|
|
108
99
|
unless action_name = method_for_action(action_name)
|
109
|
-
raise ActionNotFound, "The action '#{action}' could not be found"
|
100
|
+
raise ActionNotFound, "The action '#{action}' could not be found for #{self.class.name}"
|
110
101
|
end
|
111
102
|
|
112
103
|
@_response_body = nil
|
@@ -50,8 +50,8 @@ module AbstractController
|
|
50
50
|
if controller.respond_to?(:_helpers)
|
51
51
|
include controller._helpers
|
52
52
|
|
53
|
-
if controller.respond_to?(:
|
54
|
-
include controller.
|
53
|
+
if controller.respond_to?(:_routes)
|
54
|
+
include controller._routes.url_helpers
|
55
55
|
end
|
56
56
|
|
57
57
|
# TODO: Fix RJS to not require this
|
@@ -5,6 +5,7 @@ module AbstractController
|
|
5
5
|
included do
|
6
6
|
class_attribute :_view_paths
|
7
7
|
self._view_paths = ActionView::PathSet.new
|
8
|
+
self._view_paths.freeze
|
8
9
|
end
|
9
10
|
|
10
11
|
delegate :find_template, :template_exists?, :view_paths, :formats, :formats=,
|
@@ -61,7 +62,7 @@ module AbstractController
|
|
61
62
|
# paths<ViewPathSet, Object>:: If a ViewPathSet is provided, use that;
|
62
63
|
# otherwise, process the parameter into a ViewPathSet.
|
63
64
|
def view_paths=(paths)
|
64
|
-
self._view_paths =
|
65
|
+
self._view_paths = ActionView::Base.process_view_paths(paths)
|
65
66
|
self._view_paths.freeze
|
66
67
|
end
|
67
68
|
end
|
data/lib/action_controller.rb
CHANGED
@@ -6,7 +6,6 @@ module ActionController
|
|
6
6
|
|
7
7
|
autoload :Base
|
8
8
|
autoload :Caching
|
9
|
-
autoload :PolymorphicRoutes
|
10
9
|
autoload :Metal
|
11
10
|
autoload :Middleware
|
12
11
|
|
@@ -67,7 +66,7 @@ end
|
|
67
66
|
require 'action_view'
|
68
67
|
require 'action_controller/vendor/html-scanner'
|
69
68
|
|
70
|
-
# Common
|
69
|
+
# Common Active Support usage in Action Controller
|
71
70
|
require 'active_support/concern'
|
72
71
|
require 'active_support/core_ext/class/attribute_accessors'
|
73
72
|
require 'active_support/core_ext/load_error'
|