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.

Files changed (102) hide show
  1. data/CHANGELOG +36 -0
  2. data/{README → README.rdoc} +79 -137
  3. data/lib/abstract_controller.rb +1 -0
  4. data/lib/abstract_controller/asset_paths.rb +1 -1
  5. data/lib/abstract_controller/base.rb +3 -12
  6. data/lib/abstract_controller/rendering.rb +2 -2
  7. data/lib/abstract_controller/view_paths.rb +2 -1
  8. data/lib/action_controller.rb +1 -2
  9. data/lib/action_controller/base.rb +3 -9
  10. data/lib/action_controller/log_subscriber.rb +56 -0
  11. data/lib/action_controller/metal.rb +10 -3
  12. data/lib/action_controller/metal/helpers.rb +5 -4
  13. data/lib/action_controller/metal/hide_actions.rb +3 -3
  14. data/lib/action_controller/metal/instrumentation.rb +2 -1
  15. data/lib/action_controller/metal/mime_responds.rb +13 -10
  16. data/lib/action_controller/metal/rack_delegation.rb +0 -4
  17. data/lib/action_controller/metal/request_forgery_protection.rb +1 -1
  18. data/lib/action_controller/metal/rescue.rb +9 -0
  19. data/lib/action_controller/metal/responder.rb +13 -5
  20. data/lib/action_controller/metal/streaming.rb +2 -0
  21. data/lib/action_controller/metal/url_for.rb +5 -5
  22. data/lib/action_controller/railtie.rb +14 -23
  23. data/lib/action_controller/record_identifier.rb +6 -25
  24. data/lib/action_controller/test_case.rb +18 -6
  25. data/lib/action_controller/vendor/html-scanner/html/node.rb +1 -0
  26. data/lib/action_controller/vendor/html-scanner/html/tokenizer.rb +1 -0
  27. data/lib/action_dispatch.rb +6 -0
  28. data/lib/action_dispatch/http/cache.rb +2 -2
  29. data/lib/action_dispatch/http/filter_parameters.rb +10 -66
  30. data/lib/action_dispatch/http/mime_type.rb +1 -1
  31. data/lib/action_dispatch/http/parameter_filter.rb +72 -0
  32. data/lib/action_dispatch/http/parameters.rb +31 -2
  33. data/lib/action_dispatch/http/request.rb +4 -1
  34. data/lib/action_dispatch/http/upload.rb +2 -2
  35. data/lib/action_dispatch/middleware/callbacks.rb +4 -4
  36. data/lib/action_dispatch/middleware/cookies.rb +39 -6
  37. data/lib/action_dispatch/middleware/flash.rb +9 -2
  38. data/lib/action_dispatch/middleware/session/abstract_store.rb +121 -36
  39. data/lib/action_dispatch/middleware/session/cookie_store.rb +26 -19
  40. data/lib/action_dispatch/middleware/session/mem_cache_store.rb +9 -1
  41. data/lib/action_dispatch/middleware/show_exceptions.rb +2 -2
  42. data/lib/action_dispatch/middleware/stack.rb +12 -5
  43. data/lib/action_dispatch/railtie.rb +1 -1
  44. data/lib/action_dispatch/routing.rb +11 -13
  45. data/lib/action_dispatch/routing/deprecated_mapper.rb +6 -388
  46. data/lib/action_dispatch/routing/mapper.rb +364 -234
  47. data/lib/action_dispatch/routing/polymorphic_routes.rb +186 -0
  48. data/lib/action_dispatch/routing/route.rb +11 -2
  49. data/lib/action_dispatch/routing/route_set.rb +62 -28
  50. data/lib/action_dispatch/routing/url_for.rb +2 -1
  51. data/lib/action_dispatch/testing/assertions.rb +0 -2
  52. data/lib/action_dispatch/testing/assertions/routing.rb +0 -1
  53. data/lib/action_dispatch/testing/assertions/selector.rb +20 -24
  54. data/lib/action_dispatch/testing/integration.rb +2 -2
  55. data/lib/action_dispatch/testing/test_response.rb +2 -2
  56. data/lib/action_pack/version.rb +1 -1
  57. data/lib/action_view.rb +1 -0
  58. data/lib/action_view/base.rb +20 -21
  59. data/lib/action_view/context.rb +9 -12
  60. data/lib/action_view/helpers.rb +0 -2
  61. data/lib/action_view/helpers/active_model_helper.rb +17 -2
  62. data/lib/action_view/helpers/asset_tag_helper.rb +15 -33
  63. data/lib/action_view/helpers/atom_feed_helper.rb +5 -3
  64. data/lib/action_view/helpers/cache_helper.rb +4 -2
  65. data/lib/action_view/helpers/capture_helper.rb +4 -4
  66. data/lib/action_view/helpers/csrf_helper.rb +3 -1
  67. data/lib/action_view/helpers/date_helper.rb +10 -5
  68. data/lib/action_view/helpers/debug_helper.rb +3 -1
  69. data/lib/action_view/helpers/form_helper.rb +36 -30
  70. data/lib/action_view/helpers/form_options_helper.rb +7 -6
  71. data/lib/action_view/helpers/form_tag_helper.rb +17 -6
  72. data/lib/action_view/helpers/javascript_helper.rb +1 -0
  73. data/lib/action_view/helpers/number_helper.rb +16 -45
  74. data/lib/action_view/helpers/prototype_helper.rb +14 -16
  75. data/lib/action_view/helpers/raw_output_helper.rb +9 -0
  76. data/lib/action_view/helpers/record_tag_helper.rb +5 -0
  77. data/lib/action_view/helpers/sanitize_helper.rb +26 -20
  78. data/lib/action_view/helpers/scriptaculous_helper.rb +6 -5
  79. data/lib/action_view/helpers/tag_helper.rb +2 -1
  80. data/lib/action_view/helpers/text_helper.rb +24 -111
  81. data/lib/action_view/helpers/translation_helper.rb +17 -10
  82. data/lib/action_view/helpers/url_helper.rb +26 -33
  83. data/lib/action_view/log_subscriber.rb +28 -0
  84. data/lib/action_view/lookup_context.rb +2 -0
  85. data/lib/action_view/paths.rb +1 -0
  86. data/lib/action_view/railtie.rb +15 -3
  87. data/lib/action_view/render/layouts.rb +2 -1
  88. data/lib/action_view/render/partials.rb +3 -1
  89. data/lib/action_view/render/rendering.rb +2 -1
  90. data/lib/action_view/template.rb +12 -8
  91. data/lib/action_view/template/error.rb +1 -0
  92. data/lib/action_view/template/handlers.rb +1 -0
  93. data/lib/action_view/template/resolver.rb +2 -1
  94. data/lib/action_view/template/text.rb +1 -0
  95. data/lib/action_view/test_case.rb +42 -20
  96. metadata +44 -23
  97. data/lib/action_controller/polymorphic_routes.rb +0 -182
  98. data/lib/action_controller/railties/log_subscriber.rb +0 -56
  99. data/lib/action_controller/railties/url_helpers.rb +0 -14
  100. data/lib/action_dispatch/testing/assertions/model.rb +0 -19
  101. data/lib/action_view/helpers/record_identification_helper.rb +0 -20
  102. 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]
@@ -1,34 +1,35 @@
1
- = Action Pack -- On rails from request to response
2
-
3
- Action Pack splits the response to a web request into a controller part
4
- (performing the logic) and a view part (rendering a template). This two-step
5
- approach is known as an action, which will normally create, read, update, or
6
- delete (CRUD for short) some sort of model part (often backed by a database)
7
- before choosing either to render a template or redirecting to another action.
8
-
9
- Action Pack implements these actions as public methods on Action Controllers
10
- and uses Action Views to implement the template rendering. Action Controllers
11
- are then responsible for handling all the actions relating to a certain part
12
- of an application. This grouping usually consists of actions for lists and for
13
- CRUDs revolving around a single (or a few) model objects. So ContactsController
14
- would be responsible for listing contacts, creating, deleting, and updating
15
- contacts. A WeblogController could be responsible for both posts and comments.
16
-
17
- Action View templates are written using embedded Ruby in tags mingled in with
18
- the HTML. To avoid cluttering the templates with code, a bunch of helper
19
- classes provide common behavior for forms, dates, and strings. And it's easy
20
- to add specific helpers to keep the separation as the application evolves.
21
-
22
- Note: Some of the features, such as scaffolding and form building, are tied to
23
- ActiveRecord[http://activerecord.rubyonrails.org] (an object-relational
24
- mapping package), but that doesn't mean that Action Pack depends on Active
25
- Record. Action Pack is an independent package that can be used with any sort
26
- of backend (Instiki[http://www.instiki.org], which is based on an older version
27
- of Action Pack, used Madeleine for example). Read more about the role Action
28
- Pack can play when used together with Active Record on
29
- http://www.rubyonrails.org.
30
-
31
- A short rundown of the major features:
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.attributes = params[:customer]
44
- @customer.save ?
45
- redirect_to(:action => "show") :
46
- render(:action => "edit")
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() Customer.find(params[:id]) end
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
- * Embedded Ruby for templates (no new "easy" template language)
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-based templates (great for XML content, like RSS)
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 processing of the response (as methods, procs, and classes)
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
- <%= text_field "post", "title", "size" => 30 %>
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 (think simple version of Struts
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 urls incredibly easy
160
+ * Routing makes pretty URLs incredibly easy
154
161
 
155
- map.connect 'clients/:client_name/:project_name/:controller/:action'
162
+ match 'clients/:client_name/:project_name/:controller/:action'
156
163
 
157
- Accessing /clients/37signals/basecamp/project/dash calls ProjectController#dash with
158
- { "client_name" => "37signals", "project_name" => "basecamp" } in params[: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 URL, you can rewrite the redirect in a number of ways:
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/dash
170
+ /clients/37signals/basecamp/project/edit
164
171
 
165
172
  redirect_to(:client_name => "nextangle", :project_name => "rails") =>
166
- /clients/nextangle/rails/project/dash
173
+ /clients/nextangle/rails/project/index
167
174
 
168
- {Learn more}[link:classes/ActionController/Base.html]
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
- Processing WeblogController#index (for 127.0.0.1 at Fri May 28 00:41:55)
187
- Parameters: {"action"=>"index", "controller"=>"weblog"}
188
- Rendering weblog/index (200 OK)
189
- Completed in 0.029281 (34 reqs/sec)
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
- Processing PostsController#create (for 127.0.0.1 at Sat Jun 19 14:04:23)
195
- Params: {"controller"=>"posts", "action"=>"create",
196
- "post"=>{"title"=>"this is good"} }
197
- SQL (0.000627) INSERT INTO posts (title) VALUES('this is good')
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 0.221764 (4 reqs/sec) | DB: 0.059920 (27%)
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 found at
320
+ The latest version of Action Pack can be installed with Rubygems:
370
321
 
371
- * http://rubyforge.org/project/showfiles.php?group_id=249
322
+ % [sudo] gem install actionpack
372
323
 
373
- Documentation can be found at
324
+ Source code can be downloaded as part of the Rails project on GitHub
374
325
 
375
- * http://api.rubyonrails.com
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
- The Action Pack homepage is http://www.rubyonrails.org. You can find
395
- the Action Pack RubyForge page at http://rubyforge.org/projects/actionpack.
396
- And as Jim from Rake says:
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
- Feel free to submit commits or feature requests. If you send a patch,
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
@@ -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'
@@ -3,7 +3,7 @@ module AbstractController
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  included do
6
- config_accessor :assets_dir, :javascripts_dir, :stylesheets_dir
6
+ config_accessor :asset_host, :asset_path, :assets_dir, :javascripts_dir, :stylesheets_dir
7
7
  end
8
8
  end
9
9
  end
@@ -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?(:_router)
54
- include controller._router.url_helpers
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 = paths.is_a?(ActionView::PathSet) ? paths : ActionView::Base.process_view_paths(paths)
65
+ self._view_paths = ActionView::Base.process_view_paths(paths)
65
66
  self._view_paths.freeze
66
67
  end
67
68
  end
@@ -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 ActiveSupport usage in ActionController
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'