method

around_filter

Importance_1
Ruby on Rails latest stable (v7.1.3.2) - 1 note - Class: AbstractController::Callbacks::ClassMethods

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v3.2.13) is shown here.

around_filter public

Append an around filter. See _insert_callbacks for parameter details.

Show source
Register or log in to add new notes.
May 10, 2012
0 thanks

block only and except

Code

class Journal < ActionController::Base
  # Require authentication for edit and delete.
  before_filter :authorize, :only => [:edit, :delete]

  # Passing options to a filter with a block.
  around_filter(:except => :index) do |controller, action_block|
    results = Profiler.run(&action_block)
    controller.response.sub! "</body>", "#{results}</body>"
  end

  private
    def authorize
      # Redirect to login unless authenticated.
    end
end