Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #1291 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

[PATCH] Small failure in documentation (action_controller/filters.rb -> before_filter with a block )

Reported by: raidel@onemail.at Assigned to: David
Priority: low Milestone: 1.0
Component: ActionPack Version: 0.12.1
Severity: trivial Keywords: documentation
Cc:

Description

Hoping that this isn't too trivial for creating a new ticket:

before_filter { |controller| return false if controller.paramsstop_action? }

returns a thread-error, IMHO should be:

before_filter(lambda { |controller| return false if controller.paramsstop_action? })

or (as suggested by Duane Johnson on the mailing-list):

before_filter { |controller| false if controller.paramsstop_action? }

an appropriate diff:

--- filters_back.rb     2005-05-12 15:13:26.983922176 +0200
+++ filters.rb  2005-05-12 15:13:46.053023232 +0200
@@ -69,7 +69,7 @@
     # Or just as a quick test. It works like this:
     #
     #   class WeblogController < ActionController::Base
-    #     before_filter { |controller| return false if controller.params["stop_action"] }
+    #     before_filter { |controller| false if controller.params["stop_action"] }
     #   end
     #
     # As you can see, the block expects to be passed the controller after it has assigned the request to the internal variables.

Change History

05/12/05 20:24:30 changed by anonymous

  • summary changed from Small failure in documentation (action_controller/filters.rb -> before_filter with a block ) to [PATCH] Small failure in documentation (action_controller/filters.rb -> before_filter with a block ).
  • milestone set to 1.0.

05/19/05 17:14:44 changed by david

  • status changed from new to closed.
  • resolution set to fixed.