Simple Rails web db console
Ruby JavaScript
Latest commit 238e844 Mar 4, 2011 @funny-falcon Version bump to 0.0.9
Permalink
Failed to load latest commit information.
lib fix small errors Mar 4, 2011
public fix small errors Mar 4, 2011
rails Initial commit Nov 29, 2010
views implement row edit Feb 13, 2011
.gitignore don't bother with vim swap files Dec 23, 2010
MIT-LICENSE Initial commit Nov 29, 2010
README fix README authentication example Dec 28, 2010
Rakefile some files reorganization Dec 3, 2010
VERSION Version bump to 0.0.9 Mar 4, 2011
init.rb Initial commit Nov 29, 2010

README

= RailsDbBrowser

Simple database browser for Rails application backed by ActiveRecord

== Instalation

=== Rails 2.3

in config/environment.rb

    config.gem 'rails_db_browser'

and then create an app/metal/db_browse.rb

    DbBrowse = RailsDbBrowser::Runner.new('/db_browse')
    
=== Rails 3

in Rails 3 in Gemfile

    gem 'rails_db_browser'

in config/routes.rb

  match "db_browse(/*s)", :to => RailsDbBrowser::Runner.new('/db_browse')

== Security

It is up to you to provide security.

You could check environment and run browser only in development.
If you user Rails 2.3 then you still should provide empty Rack application as metal

  class DbBrowse
    def self.call(env)
      [404, nil, nil]
    end
  end
  
You could use Rack::Builder with combination of any Rack authentication middleware

  DbBrowse = Rack::Builder.new do
    use RailsDbBrowser::URLTruncate, '/db_browse'
    use Rack::Auth::Basic, 'db_browser' do |user, password|
      user == 'admin' && password == 'iamgod'
    end
    run RailsDbBrowser::DbBrowser
  end
  
(Well, I've tested it in Rails2.3. Rails3 application with Devise falls on wrong password) 

== Repository

Source is hosted on github

http://github.com/funny-falcon/rails_db_browser

== Copyright

Copyright (c) 2010 Sokolov Yura aka funny_falcon, released under the MIT license