fosdem2011
DESCRIPTION
TRANSCRIPT
RailsAdminThe right way of doing data administration
Bogdan GazaFOSDEM 2011
FOSDEM 2011 @hurrycane
Sunday, February 6, 2011
@hurrycane
$ whoami
Student at Faculty of Computer Science, Iasi, Romania
Developer at MojoTech
RubySOC 2010 student
@hurrycane
FOSDEM 2011
Sunday, February 6, 2011
@hurrycane
Data administration is ________*
talking in the context of a web app*FOSDEM 2011
Sunday, February 6, 2011
@hurrycane
... the way you organize and control your data
FOSDEM 2011
Sunday, February 6, 2011
@hurrycane
Data administration means the admin panel.
FOSDEM 2011
Sunday, February 6, 2011
HOW?
@hurrycane
Both simple, secure and fast
FOSDEM 2011
Sunday, February 6, 2011
Most people write custom admin panels.
@hurrycane
not very simple
definitely NOT fast
prone to errors
FOSDEM 2011
Sunday, February 6, 2011
Other use CMSs
@hurrycane
simple but not flexible
NOT fastusually secure
FOSDEM 2011
Sunday, February 6, 2011
The Rails way of doing it is using a plugin engine.
@hurrycane
simplefast
usually secure
FOSDEM 2011
Sunday, February 6, 2011
@hurrycane
RailsAdminIntroducing
http://github.com/sferik/rails_admin/
FOSDEM 2011
Sunday, February 6, 2011
@hurrycane
RubySOC 2010 Project
mentorsErik Michaels-Ober,
Yehuda Katz,Rodrigo Rosenfeld Rosas,Luke van der Hoeven and
Rein Henrichs.
FOSDEM 2011
Sunday, February 6, 2011
Began as Erik’s MerbAdmin and then got ported to Rails 3
@hurrycaneFOSDEM 2011
Sunday, February 6, 2011
@hurrycane
RailsAdmin is a Rails Engine
FOSDEM 2011
Sunday, February 6, 2011
@hurrycane
require 'rails_admin/abstract_model'
module RailsAdmin class ApplicationController < ::ApplicationController
endend
Basic Enginescontrollers
FOSDEM 2011
Sunday, February 6, 2011
@hurrycane
Basic Engines
module RailsAdmin class History < ActiveRecord::Base
endend
models
FOSDEM 2011
Sunday, February 6, 2011
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
@hurrycane
Basic Enginesroutes
For more info checkout the mountable apps RubySOC project.
FOSDEM 2011
Sunday, February 6, 2011
@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
FOSDEM 2011
Sunday, February 6, 2011
@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:
FOSDEM 2011
Sunday, February 6, 2011
With Rails 3.1 Rails Admin will be mountable. (Thanks
to Piotr!)
@hurrycaneFOSDEM 2011
Sunday, February 6, 2011
Rails.application.routes.draw do mount Admin::Engine => "/admin"end
@hurrycaneFOSDEM 2011
Sunday, February 6, 2011
@hurrycane
DEMO
FOSDEM 2011
Sunday, February 6, 2011
@hurrycane
RailsAdmin 1.0 in a few weeks.
FOSDEM 2011
Sunday, February 6, 2011
RailsAdmin.config do |config| config.model Team do navigation do visible false end endend
@hurrycaneFOSDEM 2011
RailsAdmin - configuration DSL
Sunday, February 6, 2011
@hurrycane
QAWhy
Devise? Does it need to
have authentication?
Configuration? Permissions
FOSDEM 2011
Sunday, February 6, 2011
Thanks!
@hurrycaneFOSDEM 2011
Sunday, February 6, 2011