@@ -266,6 +266,43 @@ class UsersController < ApplicationController
266
266
end
267
267
----
268
268
269
+ === Action Filters Order [[action-filters-order]]
270
+
271
+ Order controller filter declarations in the order in which they will be executed.
272
+
273
+ [source,ruby]
274
+ ----
275
+ # bad
276
+ class UsersController < ApplicationController
277
+ after_action :after_action_filter
278
+ around_action :around_action_filter1
279
+ before_action :before_action_filter1
280
+ prepend_around_action :prepend_around_action_filter
281
+ prepend_after_action :prepend_after_action_filter
282
+ append_around_action :append_around_action_filter
283
+ append_before_action :append_before_action_filter
284
+ around_action :around_action_filter2
285
+ prepend_before_action :prepend_before_action_filter
286
+ append_after_action :append_after_action_filter
287
+ before_action :before_action_filter2
288
+ end
289
+
290
+ # good
291
+ class UsersController < ApplicationController
292
+ before_action :before_action_filter1
293
+ before_action :before_action_filter2
294
+ around_action :around_action_filter1
295
+ around_action :around_action_filter2
296
+ after_action :after_action_filter
297
+ append_before_action :append_before_action_filter
298
+ append_around_action :append_around_action_filter
299
+ append_after_action :append_after_action_filter
300
+ prepend_before_action :prepend_before_action_filter
301
+ prepend_around_action :prepend_around_action_filter
302
+ prepend_after_action :prepend_after_action_filter
303
+ end
304
+ ----
305
+
269
306
== Controllers: Rendering [[rendering]]
270
307
271
308
=== Inline Rendering [[inline-rendering]]
0 commit comments