www.SmarteGuru.com
  Home | Blogs | Recipe | Find a Friend | Discussion Board | Resources | Developers Area | Articles | Health |  Login | Register Now 

Ruby on rails plugins-roll_admin_model: manage your plugin using browser

This plugin allows you to manage your plugin using browser in a totally non-intrusive manner.

Although it is a plugin I have put up the whole project on the github since it is much easier to play with the plugin in this way. If you want the plugin then go to vendor/plugins directory and copy roll_admin_model directory from http://github.com/neerajdotname/roll_admin_model/tree/master.

Usage:
After installing the plugin you need to put following lines of code in config/routes.rb at the very top

RollAdminModel::Routing.connect_with map

Given below is an example of how to add to routing.rb

ActionController::Routing::Routes.draw do |map|
RollAdminModel::Routing.connect_with map
map.resources :comments
map.resources :articles
map.resources :users
map.root :controller => "admin_model"
map.connect ':controller/:action/:id'
end


Running this app and setting up environment:

sudo gem install faker
sudo gem install will_paginate
rake db:create
rake db:migrate
rake db:generate_fake_data
ruby script/server
http://localhost:3000


Securing it:

This plugin will allow access to browse the models without any authorization check in development environment.
However in other environment a security check is enforced. In order to secure this plugin please ensure that
ROLL_ADMIN_MODEL_AUTH is a proc which checks for authorization.

Given below is one way to ensure authentication.

ROLL_ADMIN_MODEL_AUTH = Proc.new { |controller| controller.send("admin_logged_in?") }

Related Posts

Tags: , , , , ,


Viewed: 349 views

One Response to “Ruby on rails plugins-roll_admin_model: manage your plugin using browser”

  1. Evgeny Says:

    Sounds interesting, but i would be afraid to use it because of all the spelling mistakes.
    Whats a Roll anyway in this context?

Leave a Reply

Comment moderation is enabled. Your comment may take some time to appear.

Home - About Us - Help - Terms and Conditions - Site Map - Link to Us - Resources - Contact Us
Google Rank Calculator | Suggest developer resource | Suggest Article
All rights reserved © 2007 SmarteGuru.com.