0.0
No commit activity in last 3 years
No release in over 3 years
actiondebug is a utility that can give you more insight into the structure of your Rails application. It can show all filters that a controller is using, grouped by action. It can also report which actions skip a given filter. Its extendability is essentially endless. Great tool for security researchers and developers alike.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.5
>= 0
 Project Readme

actiondebug

A gem to show which *_filters affect your Rails controllers. Useful for security research (which controllers and actions skip an auth check?) and debugging development problems (why isn't a method running for a given request?)

Examples

Sample Application

class ApplicationController < ActionController::Base
  before_filter :require_login
  before_filter :refresh_session

  def index
  end

  private
  def require_login
  end

  def refresh_session
  end
end

class SessionsController < ApplicationController
  skip_before_filter :require_login, :except => :active
  before_filter :update_session, :only => :create
  before_filter :destroy_session, :only => :new

  def index
  end

  def new
  end

  def create
  end

  def active
  end

  private
  def udpate_session
  end

  def destroy_session
  end
end

Commands in Rails Console

## Show all actions and filters for controllers which inherit from a controller (including itself)
> ApplicationController.filters_for_self_and_descendants
# => {
#     :ApplicationController => {:index => [:require_login, :refresh_session]},
#     :SessionsController => {
#                              :index => [:refresh_sesion],
#                              :new => [:refresh_session, :destroy_session],
#                              :create => [:refresh_session, :update_session],
#                              :active => [:require_login, :refresh_session]
#                            }
#    }

## Show all filters used by a controller
> SessionsController.filters
# => {
#      :index => [:refresh_session],
#      :create => [:refresh_session, :destroy_session],
#      :new => [:refresh_session, :udpate_session],
#      :active => [:require_login, :refresh_session]
#    }

## Show all before filters for a given action
> SessionsController.before_filters(:new)
# => {
#     :new => [:refresh_session, :update_session]
#    }

## Show all actions which skip a given filter, scoped to self and descendants
> ApplicationController.actions_skipping_filter(:require_login)
# => {
#      :SessionsController => [:index, :new, :create]
#    }

Installation

Using Bundler

# From https://rubygems.org
gem 'actiondebug', '~> 1.0.0'

# From github
gem 'actiondebug', '~> 1.0.0', git: "https://github.com/rbhitchcock/actiondebug"

Standalone Gem

gem -v '1.0.0' actiondebug

From source

> git clone https://github.com/rbhitchcock/actiondebug.git
> cd actiondebug
> rake install