method

around_filter

around_filter
public

Append an around filter. See _insert_callbacks for parameter details.

1Note

block only and except

azhao ยท May 9, 2012

==== 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