- rails-firephp gem
Homepage: http://rubyforge.org/projects/rails-firephp/
Rails plugin to go along with it: http://github.com/smith/firephp_rails/tree/master
- FirePHRuby
Homepage: http://firephruby.rubyforge.org/
Project Site: http://rubyforge.org/projects/firephruby/
Quick Reference
- Install FirePHRuby with
$ gem install firephruby
- For Ruby on Rails put require 'firephruby' in your
app/controllers/application.rb
In a Rails controller action do:
fire_log 'Log message'
fire_info 'Info message'
fire_warn 'Warn message'
fire_error 'Error message'
- In an erb-template:
<% fire_log 'Log message' %>
<% fire_info 'Info message' %>
<% fire_warn 'Warn message' %>
<% fire_error 'Error message' %>
- In CGI require 'firephruby'
console = Fireruby::CGI.new
console.log('Log message')
console.info('Info message')
console.warn('Warn message')
console.error('Error message')
or with plain WEBrick (similiar for Mongrel):
require 'firephruby'
# then within do_GET or a mounted Proc:
response.fire_log 'Log message'
response.fire_info 'Info message'
response.fire_warn "Warn message"
response.fire_error "Error message"
These examples all display the familiar
No comments:
Post a Comment