Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

156 lines (101 sloc) 4.287 kB
Rails Footnotes
License: MIT
Version: 3.6.7
You can also read this README in pretty html at the GitHub project Wiki page
If you are developing in Rails you should know the plugin! It displays
footnotes in your application for easy debugging, such as sessions,
request parameters, cookies, filter chain, routes, queries, etc.
Even more, it contains links to open files directly in your editor including
your backtrace lines.
Install Rails Footnotes is very easy. If you are running on Rails 2.3 just run
the following:
sudo gem install rails-footnotes
In RAILS_ROOT/config/environments/development.rb (yes, you want it only in development):
config.gem "rails-footnotes"
If you want it as plugin, just do:
script/plugin install git://
If you are not using Textmate as text editor, in your environment.rb or
in an initializer do:
if defined?(Footnotes)
Footnotes::Filter.prefix = 'txmt://open?url=file://%s&line=%d&column=%d'
Where you are going to choose a prefix compatible with your text editor. The %s is
replaced by the name of the file, the first %d is replaced by the line number and
the second %d is replaced by the column.
By default, footnotes are appended at the end of the page with default stylesheet. If you want
to change their position, you can define a div with id "footnotes_holder" or define your own stylesheet
by turning footnotes stylesheet off:
Footnotes::Filter.no_style = true
Another option is to allow multiple notes to be opened at the same time:
Footnotes::Filter.multiple_notes = true
If you have New Relic RPM installed, you may want to turn off query explains
(explains can slows things down)
Footnotes::Notes::QueriesNote.sql_explain = false
If you want to add alternate logic to enable or disable footnotes,
add something like this to environment.rb:
ENABLE_RAILS_FOOTNOTES=(Rails.env.production? == false)
Finally, you can control which notes you want to show. The default are:
Footnotes::Filter.notes = [:session, :cookies, :params, :filters, :routes, :env, :queries, :log, :general]
Creating your own notes
Create your notes to integrate with Footnotes is easy.
1. Create a Footnotes::Notes::YourExampleNote class
2. Implement the necessary methods (check abstract_note.rb file in lib/notes)
3. Append your example note in Footnotes::Filter.notes array (usually at the end of your environment file or in an initializer):
For example, to create a note that shows info about the user logged in your application you just have to do:
module Footnotes
module Notes
class CurrentUserNote < AbstractNote
# This method always receives a controller
def initialize(controller)
@current_user = controller.instance_variable_get("@current_user")
# The name that will appear as legend in fieldsets
def legend
"Current user: #{}"
# This Note is only valid if we actually found an user
# If it's not valid, it won't be displayed
def valid?
# The fieldset content
def content
Then put in your environment:
Footnotes::Filter.notes += [:current_user]
* Leon Li -
* Keenan Brock -
* Ivan Storck -
* Kris Chamber -
Bugs and Feedback
If you discover any bugs, please send an e-mail to
If you just want to give some positive feedback or drop a line, that's fine too!
Version 3.x
This plugin was maintained until version 3.6 by José Valim
Copyright (c) 2009 José Valim (
Version 2.0
This plugin was created and maintained until version 2.0 by Duane Johnson:
Copyright (c) 2006 InquiryLabs, Inc.
Jump to Line
Something went wrong with that request. Please try again.