RailsAdminThe right way of doing data administration
Bogdan GazaRubyAndRails 2010
RubyAndRails 2010 @hurrycane
Thursday, October 21, 2010
RubyAndRails 2010 @hurrycane
$ whoami
Student at Faculty of Computer Science, Iasi, Romania
Freelance web developer
RubySOC 2010 student
@hurrycane
Thursday, October 21, 2010
RubyAndRails 2010 @hurrycane
Data administration is ________*SPEAK UP!
talking in the context of a web app*
Thursday, October 21, 2010
RubyAndRails 2010 @hurrycane
... the way you organize and control your data
Thursday, October 21, 2010
RubyAndRails 2010 @hurrycane
Data administration means the admin panel.
Thursday, October 21, 2010
HOW?
RubyAndRails 2010 @hurrycane
Both simple, secure and fast
Thursday, October 21, 2010
Most people write custom admin panels.
RubyAndRails 2010 @hurrycane
not very simple
definitely NOT fast
prone to errors
Thursday, October 21, 2010
Other use CMSs
RubyAndRails 2010 @hurrycane
simple but not flexibleNOT fast
usually secure
Thursday, October 21, 2010
The Rails way of doing it using a plugin engine.
RubyAndRails 2010 @hurrycane
simple
fast
usually secure
Thursday, October 21, 2010
RubyAndRails 2010 @hurrycane
And the choices are:
Thursday, October 21, 2010
lipsiaAdmin
RubyAndRails 2010 @hurrycane
www.lipsiadmin.com
ExtJS | permissions | Rails 2.x
Thursday, October 21, 2010
RubyAndRails 2010 @hurrycane
ActiveScaffold
http://www.activescaffold.com/
Embed-able | Third-Party-Plugins | Rails 2.x
Thursday, October 21, 2010
RubyAndRails 2010 @hurrycane
Hobo
http://hobocentral.net/
WebAppBuilder | Permissions | Rails 3.x
Thursday, October 21, 2010
RubyAndRails 2010 @hurrycane
RailsAdminIntroducing
http://github.com/sferik/rails_admin/
Thursday, October 21, 2010
RubyAndRails 2010 @hurrycane
RubySOC 2010 Project
mentorsErik Michaels-Ober,
Yehuda Katz,Rodrigo Rosenfeld Rosas,Luke van der Hoeven and
Rein Henrichs.
Thursday, October 21, 2010
Began as Erik’s MerbAdmin and then got ported to
Rails 3
RubyAndRails 2010 @hurrycane
Thursday, October 21, 2010
RubyAndRails 2010 @hurrycane
RailsAdmin is a Rails Engine
Thursday, October 21, 2010
RubyAndRails 2010 @hurrycane
require 'rails_admin/abstract_model'
module RailsAdmin class ApplicationController < ::ApplicationController
endend
Basic Enginescontrollers
Thursday, October 21, 2010
RubyAndRails 2010 @hurrycane
Basic Engines
module RailsAdmin class History < ActiveRecord::Base
endend
models
Thursday, October 21, 2010
Rails.application.routes.draw do
# Routes for rails_admin controller controller "main" do match "/", :to => :index, :as => "dashboard" match "/:model_name", :to => :list, :as => "list" ... endend
RubyAndRails 2010 @hurrycane
Basic Enginesroutes
For more info checkout the mountable apps RubySOC project.
Thursday, October 21, 2010
RubyAndRails 2010 @hurrycane
RailsAdmin
C Create newR ShowU Easily UpdateD Safely Delete
} Your Data
Automatic form validation
Authentication (using Devise)
Use Action History (per row)
Multi-column-search
Thursday, October 21, 2010
RubyAndRails 2010 @hurrycane
RailsAdmin -‐ simple to install
Add in your Gemfile gem 'devise' # Devise must be required before RailsAdmin gem 'rails_admin', :git => 'git://github.com/sferik/rails_admin.git'
Run$ bundle update
$ rails generate rails_admin:install_adminAlso run:
Thursday, October 21, 2010
With Rails 3.1 Rails Admin will be mountable. (Thanks to Piotr!)
RubyAndRails 2010 @hurrycane
Thursday, October 21, 2010
Rails.application.routes.draw do mount Admin::Engine => "/admin"end
RubyAndRails 2010 @hurrycane
Thursday, October 21, 2010
RubyAndRails 2010 @hurrycane
DEMO
Thursday, October 21, 2010
RubyAndRails 2010 @hurrycane
Rails 3.1 and RailsAdmin 1.0 around theend of the year.
Thursday, October 21, 2010
RubyAndRails 2010 @hurrycane
QAWhy
Devise? Does it need to
have authentication?
Configuration? Permissions
Thursday, October 21, 2010
RubyAndRails 2010 @hurrycane
Configuration DSLexperimental
Thanks to kappa (Petteri Kääpä)!
http://gist.github.com/638153
Thursday, October 21, 2010
Thanks!
RubyAndRails 2010 @hurrycane
Thursday, October 21, 2010
Top Related