github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

josevalim / rails-footnotes

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 302
    • 26
  • Source
  • Commits
  • Network (26)
  • Issues (8)
  • Downloads (5)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (2)
    • master ✓
    • quick-test
  • Tags (5)
    • v3.6.6
    • v3.3.2
    • v3.2.2
    • v3.2
    • v3.0
Sending Request…
Click here to lend your support to: rails-footnotes and make a donation at www.pledgie.com ! Edit Pledgie Setup

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Every Rails page has footnotes that gives information about your application and links back to your editor — Read more

  cancel

http://blog.plataformatec.com.br/

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

change logs for 3.6.6 
kbrock (author)
Sun Jan 31 19:37:27 -0800 2010
commit  6a7d054d2f795c1bf5194e525d7db2e767022b0a
tree    1c2b68612b718505cb6afe2594deab839859571d
parent  8715707480ab71ba667c78a74bf89f314c4ddf59
rails-footnotes /
name age
history
message
file CHANGELOG Sun Jan 31 19:37:27 -0800 2010 change logs for 3.6.6 [kbrock]
file MIT-LICENSE Fri Jan 02 11:52:55 -0800 2009 Added gemspec and updated README. [josevalim]
file README Tue Jan 26 08:13:06 -0800 2010 Added option to load QueriesNote even when NewR... [tobias]
file Rakefile Sun Jan 31 19:37:27 -0800 2010 change logs for 3.6.6 [kbrock]
file init.rb Sun Jan 04 02:38:02 -0800 2009 Bug fix in gem. [josevalim]
directory lib/ Tue Jan 26 08:16:47 -0800 2010 Allow footnotes to be disabled with a parameter [indirect]
directory test/ Wed Dec 30 17:35:48 -0800 2009 use split("n") to create 1.8 and 1.9 compatible... [lsylvester]
README
Rails Footnotes
License: MIT
Version: 3.6.4

You can also read this README in pretty html at the GitHub project Wiki page

  http://wiki.github.com/josevalim/rails-footnotes


Description
-----------

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.


Installation
------------

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://github.com/josevalim/rails-footnotes.git

Configuration
-------------

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'
  end

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

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]

The queries note by default will not load if it detects New Relic loaded in the app. If you want to load it
in this case, add the following to an initializer:

Footnotes::Notes::QueriesNote.include_when_new_relic_installed = true if defined?(Footnotes)

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")
        end

        # The name that will appear as legend in fieldsets
        #
        def legend
          "Current user: #{@current_user.name}"
        end

        # This Note is only valid if we actually found an user
        # If it's not valid, it won't be displayed
        #
        def valid?
          @current_user
        end

        # The fieldset content
        #
        def content
          escape(@current_user.inspect)
        end
      end
    end
  end

Then put in your environment:

  Footnotes::Filter.notes += [:current_user]


Colaborators
------------

* Leon Li       - http://github.com/scorpio
* Keenan Brock  - http://github.com/kbrock
* Ivan Storck   - http://github.com/ivanoats
* Kris Chamber  - http://github.com/kristopher


Bugs and Feedback
-----------------

If you discover any bugs, please send an e-mail to jose@plataformatec.com.br
If you just want to give some positive feedback or drop a line, that's fine too!

Copyright (c) 2009 José Valim (jose@plataformatec.com.br)
http://blog.plataformatec.com.br/


Version 2.0
-----------

This plugin was created and maintained until version 2.0 by Duane Johnson:

Copyright (c) 2006 InquiryLabs, Inc.
http://blog.inquirylabs.com/
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server