Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse and Manage your data using browser
JavaScript Ruby
Branch: master
Pull request Compare This branch is 4 commits ahead, 793 commits behind bigbinary:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
tasks
test
.gitignore
README
Rakefile
init.rb

README

ABOUT PLUGIN
=======================
This is a plugin to manage your database records using browser. 

FEATURES
===========================
Browse table records.

For each individual record a snapshot of all association records is shown. Currently the associations that
are supported are has_many, belongs_to and has_one. Next to the association name, a count of number of 
associated records is shown. All the associated records are link so you can jump from record to record. If
an associated record is not present then there will be no link.

Quick search across all records in the table.

Advance search including all columns of table.

Browse migration records from the table even though there is no corresponding model for it.

Add a new record (persmission check enforced)

Edit an existing record (persmission check enforced)

Delete an existing record (persmission check enforced and no callbacks)

Destroy an existing record (persmission check enforced and callbacks will be invoked)

All the features are povided without using named_scope. So no new method is added to the model. It is 
totally non-intrusive from that point of view.

LIVE DEMO
===============
http://www.neeraj.name/admin_data
Note that in the demo you will be accessing only features available for read only. You will not be
able to update/delete/create any record. 

REQUIREMENT
==========================
Your rails project must be using Rails 2.2 or higher.

HOW TO INSTALL THIS PLUGIN
==========================
ruby script/plugin install git://github.com/neerajdotname/admin_data.git

HOW TO USE IT
======================
After installing the plugin you need to put following lines of code in config/routes.rb  at the very top
AdminData::Routing.connect_with map. After the lines have been added it might look like this

ActionController::Routing::Routes.draw do |map|
  AdminData::Routing.connect_with map
  # ... more routing information
end

Now go to http://localhost:3000/admin_data



SECURING IT
=============================
This plugin will allow access to browse the models without any authorization check in development and test environment. 

However in other environments a security check is enforced. Given below is one way to ensure authentication. Put the following
four lines of code in an initializer at ~/config/initializers/admin_data.rb

# authorization check to access the controller
ADMIN_DATA_AUTH = Proc.new { |controller| controller.send("admin_logged_in?") }
# If you want updates to be allowed then set this constant as true
ADMIN_DATA_UPDATE_ALLOWED    = false

TESTED WITH
======================
I have tested this plugin with MySQL and PostgreSQL. 

FEEDBACK
======================
Please submit your feedback to neerajdotname [AT] gmail [DOT] com

CONTRIBUTORS
======================
Jim Gay of Saturn Flyer http://www.saturnflyer.com
Something went wrong with that request. Please try again.