SlideShare a Scribd company logo
1 of 25
Download to read offline
RailsAdmin
                           The right way of doing data administration




                                       FOSDEM 2011
                                         Bogdan Gaza


   FOSDEM 2011                                                          @hurrycane
Sunday, February 6, 2011
$ whoami

                 Student at Faculty of Computer Science, Iasi, Romania


                           Developer at MojoTech


                                RubySOC 2010 student



                                @hurrycane

   FOSDEM 2011                                                           @hurrycane
Sunday, February 6, 2011
Data administration is ________*




  * talking in the context of a web app
   FOSDEM 2011                            @hurrycane
Sunday, February 6, 2011
... the way you organize and control
                   your data

   FOSDEM 2011                                            @hurrycane
Sunday, February 6, 2011
Data administration means the admin panel.

   FOSDEM 2011                                                  @hurrycane
Sunday, February 6, 2011
HOW?
                           Both simple, secure and fast




   FOSDEM 2011                                            @hurrycane
Sunday, February 6, 2011
Most people write custom
                          admin panels.

                           prone to errors
                           definitely NOT
                                 fast
                           not very simple

   FOSDEM 2011                                 @hurrycane
Sunday, February 6, 2011
Other use CMSs

                              usually secure
                                 NOT fast
                              simple but not
                                  flexible

   FOSDEM 2011                                 @hurrycane
Sunday, February 6, 2011
The Rails way of doing it
              is using a plugin engine.
                           usually secure
                                fast
                              simple

   FOSDEM 2011                              @hurrycane
Sunday, February 6, 2011
Introducing

                             RailsAdmin

                           http://github.com/sferik/rails_admin/


   FOSDEM 2011                                                     @hurrycane
Sunday, February 6, 2011
RubySOC 2010
                              Project
                                    mentors
                              Erik Michaels-Ober,
                                  Yehuda Katz,
                            Rodrigo Rosenfeld Rosas,
                            Luke van der Hoeven and
                                 Rein Henrichs.

   FOSDEM 2011                                         @hurrycane
Sunday, February 6, 2011
Began as Erik’s
                       MerbAdmin and then
                       got ported to Rails 3



   FOSDEM 2011                                 @hurrycane
Sunday, February 6, 2011
RailsAdmin is a Rails Engine

   FOSDEM 2011                                            @hurrycane
Sunday, February 6, 2011
Basic Engines
                               controllers



    require 'rails_admin/abstract_model'

    module RailsAdmin
      class ApplicationController < ::ApplicationController

      end
    end




   FOSDEM 2011                                          @hurrycane
Sunday, February 6, 2011
Basic Engines
                                models




     module RailsAdmin
       class History < ActiveRecord::Base

       end
     end




   FOSDEM 2011                              @hurrycane
Sunday, February 6, 2011
Basic Engines
                                        routes



                  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"
                        ...
                      end
                  end




      For more info checkout the mountable apps RubySOC project.

   FOSDEM 2011                                                              @hurrycane
Sunday, February 6, 2011
RailsAdmin



                                               }
                           C   Create new
                           R   Show
                           U   Easily Update       Your Data
                           D   Safely Delete

                               Automatic form validation
                           Authentication (using Devise)

                                 Multi-column-search
                           Use Action History (per row)

   FOSDEM 2011                                                 @hurrycane
Sunday, February 6, 2011
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


  Also run:
  $ rails generate rails_admin:install_admin




   FOSDEM 2011                                                 @hurrycane
Sunday, February 6, 2011
With Rails 3.1 Rails Admin
            will be mountable. (Thanks
                     to Piotr!)



   FOSDEM 2011                       @hurrycane
Sunday, February 6, 2011
Rails.application.routes.draw do
    mount Admin::Engine => "/admin"
  end




   FOSDEM 2011                  @hurrycane
Sunday, February 6, 2011
DEMO


   FOSDEM 2011                    @hurrycane
Sunday, February 6, 2011
RailsAdmin 1.0 in a few weeks.




   FOSDEM 2011                                              @hurrycane
Sunday, February 6, 2011
RailsAdmin - configuration DSL


                           RailsAdmin.config do |config|
                             config.model Team do
                               navigation do
                                 visible false
                               end
                             end
                           end




   FOSDEM 2011                                             @hurrycane
Sunday, February 6, 2011
e?        Do
                                    vi s       hav es it
                                  De              e au      nee
                             hy                        the
                                                           ntic
                                                                 d to
                           W

                                       QA
                                                                atio
                                                                    n?


                           Con
                               figur                          ns
                                      atio             i ssio
                                          n?     Perm



   FOSDEM 2011                                                           @hurrycane
Sunday, February 6, 2011
Thanks!



   FOSDEM 2011                       @hurrycane
Sunday, February 6, 2011

More Related Content

Similar to Fosdem2011

The Fast, The Slow and the Lazy
The Fast, The Slow and the LazyThe Fast, The Slow and the Lazy
The Fast, The Slow and the LazyMaurício Linhares
 
2011 The Year of Web apps
2011 The Year of Web apps2011 The Year of Web apps
2011 The Year of Web appsJungHyuk Kwon
 
YOU WILL REGRET THIS
YOU WILL REGRET THISYOU WILL REGRET THIS
YOU WILL REGRET THISMononcQc
 
Fosdem chef-101-app-deploy
Fosdem chef-101-app-deployFosdem chef-101-app-deploy
Fosdem chef-101-app-deployjtimberman
 
잘 알려지지 않은 Php 코드 활용하기
잘 알려지지 않은 Php 코드 활용하기잘 알려지지 않은 Php 코드 활용하기
잘 알려지지 않은 Php 코드 활용하기형우 안
 
international PHP2011_ilia alshanetsky_Hidden Features of PHP
international PHP2011_ilia alshanetsky_Hidden Features of PHPinternational PHP2011_ilia alshanetsky_Hidden Features of PHP
international PHP2011_ilia alshanetsky_Hidden Features of PHPsmueller_sandsmedia
 
iPhone Python love affair
iPhone Python love affairiPhone Python love affair
iPhone Python love affairAnna Callahan
 
Using+javascript+to+build+native+i os+applications
Using+javascript+to+build+native+i os+applicationsUsing+javascript+to+build+native+i os+applications
Using+javascript+to+build+native+i os+applicationsMuhammad Ikram Ul Haq
 
SeaJS - 跨环境模块化开发实践
SeaJS - 跨环境模块化开发实践SeaJS - 跨环境模块化开发实践
SeaJS - 跨环境模块化开发实践lifesinger
 
Rest dengan restlet
Rest dengan restletRest dengan restlet
Rest dengan restletReza Lesmana
 
How to Make Entities and Influence Drupal - Emerging Patterns from Drupal Con...
How to Make Entities and Influence Drupal - Emerging Patterns from Drupal Con...How to Make Entities and Influence Drupal - Emerging Patterns from Drupal Con...
How to Make Entities and Influence Drupal - Emerging Patterns from Drupal Con...Ronald Ashri
 
Koss, How to make desktop caliber browser apps
Koss, How to make desktop caliber browser appsKoss, How to make desktop caliber browser apps
Koss, How to make desktop caliber browser appsEvil Martians
 
Java 7 - State of the Enterprise
Java 7 - State of the EnterpriseJava 7 - State of the Enterprise
Java 7 - State of the EnterpriseMarkus Eisele
 
Puppet camp europe 2011 hackability
Puppet camp europe 2011   hackabilityPuppet camp europe 2011   hackability
Puppet camp europe 2011 hackabilityPuppet
 

Similar to Fosdem2011 (17)

The Fast, The Slow and the Lazy
The Fast, The Slow and the LazyThe Fast, The Slow and the Lazy
The Fast, The Slow and the Lazy
 
2011 The Year of Web apps
2011 The Year of Web apps2011 The Year of Web apps
2011 The Year of Web apps
 
YOU WILL REGRET THIS
YOU WILL REGRET THISYOU WILL REGRET THIS
YOU WILL REGRET THIS
 
Fosdem chef-101-app-deploy
Fosdem chef-101-app-deployFosdem chef-101-app-deploy
Fosdem chef-101-app-deploy
 
잘 알려지지 않은 Php 코드 활용하기
잘 알려지지 않은 Php 코드 활용하기잘 알려지지 않은 Php 코드 활용하기
잘 알려지지 않은 Php 코드 활용하기
 
international PHP2011_ilia alshanetsky_Hidden Features of PHP
international PHP2011_ilia alshanetsky_Hidden Features of PHPinternational PHP2011_ilia alshanetsky_Hidden Features of PHP
international PHP2011_ilia alshanetsky_Hidden Features of PHP
 
iPhone Python love affair
iPhone Python love affairiPhone Python love affair
iPhone Python love affair
 
Using+javascript+to+build+native+i os+applications
Using+javascript+to+build+native+i os+applicationsUsing+javascript+to+build+native+i os+applications
Using+javascript+to+build+native+i os+applications
 
SeaJS - 跨环境模块化开发实践
SeaJS - 跨环境模块化开发实践SeaJS - 跨环境模块化开发实践
SeaJS - 跨环境模块化开发实践
 
Rest dengan restlet
Rest dengan restletRest dengan restlet
Rest dengan restlet
 
The Third WordPress
The Third WordPressThe Third WordPress
The Third WordPress
 
The Third WordPress
The Third WordPressThe Third WordPress
The Third WordPress
 
How to Make Entities and Influence Drupal - Emerging Patterns from Drupal Con...
How to Make Entities and Influence Drupal - Emerging Patterns from Drupal Con...How to Make Entities and Influence Drupal - Emerging Patterns from Drupal Con...
How to Make Entities and Influence Drupal - Emerging Patterns from Drupal Con...
 
Koss, How to make desktop caliber browser apps
Koss, How to make desktop caliber browser appsKoss, How to make desktop caliber browser apps
Koss, How to make desktop caliber browser apps
 
Groke
GrokeGroke
Groke
 
Java 7 - State of the Enterprise
Java 7 - State of the EnterpriseJava 7 - State of the Enterprise
Java 7 - State of the Enterprise
 
Puppet camp europe 2011 hackability
Puppet camp europe 2011   hackabilityPuppet camp europe 2011   hackability
Puppet camp europe 2011 hackability
 

Fosdem2011

  • 1. RailsAdmin The right way of doing data administration FOSDEM 2011 Bogdan Gaza FOSDEM 2011 @hurrycane Sunday, February 6, 2011
  • 2. $ whoami Student at Faculty of Computer Science, Iasi, Romania Developer at MojoTech RubySOC 2010 student @hurrycane FOSDEM 2011 @hurrycane Sunday, February 6, 2011
  • 3. Data administration is ________* * talking in the context of a web app FOSDEM 2011 @hurrycane Sunday, February 6, 2011
  • 4. ... the way you organize and control your data FOSDEM 2011 @hurrycane Sunday, February 6, 2011
  • 5. Data administration means the admin panel. FOSDEM 2011 @hurrycane Sunday, February 6, 2011
  • 6. HOW? Both simple, secure and fast FOSDEM 2011 @hurrycane Sunday, February 6, 2011
  • 7. Most people write custom admin panels. prone to errors definitely NOT fast not very simple FOSDEM 2011 @hurrycane Sunday, February 6, 2011
  • 8. Other use CMSs usually secure NOT fast simple but not flexible FOSDEM 2011 @hurrycane Sunday, February 6, 2011
  • 9. The Rails way of doing it is using a plugin engine. usually secure fast simple FOSDEM 2011 @hurrycane Sunday, February 6, 2011
  • 10. Introducing RailsAdmin http://github.com/sferik/rails_admin/ FOSDEM 2011 @hurrycane Sunday, February 6, 2011
  • 11. RubySOC 2010 Project mentors Erik Michaels-Ober, Yehuda Katz, Rodrigo Rosenfeld Rosas, Luke van der Hoeven and Rein Henrichs. FOSDEM 2011 @hurrycane Sunday, February 6, 2011
  • 12. Began as Erik’s MerbAdmin and then got ported to Rails 3 FOSDEM 2011 @hurrycane Sunday, February 6, 2011
  • 13. RailsAdmin is a Rails Engine FOSDEM 2011 @hurrycane Sunday, February 6, 2011
  • 14. Basic Engines controllers require 'rails_admin/abstract_model' module RailsAdmin   class ApplicationController < ::ApplicationController   end end FOSDEM 2011 @hurrycane Sunday, February 6, 2011
  • 15. Basic Engines models module RailsAdmin   class History < ActiveRecord::Base   end end FOSDEM 2011 @hurrycane Sunday, February 6, 2011
  • 16. Basic Engines routes 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"       ...     end end For more info checkout the mountable apps RubySOC project. FOSDEM 2011 @hurrycane Sunday, February 6, 2011
  • 17. RailsAdmin } C Create new R Show U Easily Update Your Data D Safely Delete Automatic form validation Authentication (using Devise) Multi-column-search Use Action History (per row) FOSDEM 2011 @hurrycane Sunday, February 6, 2011
  • 18. 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 Also run: $ rails generate rails_admin:install_admin FOSDEM 2011 @hurrycane Sunday, February 6, 2011
  • 19. With Rails 3.1 Rails Admin will be mountable. (Thanks to Piotr!) FOSDEM 2011 @hurrycane Sunday, February 6, 2011
  • 20. Rails.application.routes.draw do mount Admin::Engine => "/admin" end FOSDEM 2011 @hurrycane Sunday, February 6, 2011
  • 21. DEMO FOSDEM 2011 @hurrycane Sunday, February 6, 2011
  • 22. RailsAdmin 1.0 in a few weeks. FOSDEM 2011 @hurrycane Sunday, February 6, 2011
  • 23. RailsAdmin - configuration DSL RailsAdmin.config do |config| config.model Team do navigation do visible false end end end FOSDEM 2011 @hurrycane Sunday, February 6, 2011
  • 24. e? Do vi s hav es it De e au nee hy the ntic d to W QA atio n? Con figur ns atio i ssio n? Perm FOSDEM 2011 @hurrycane Sunday, February 6, 2011
  • 25. Thanks! FOSDEM 2011 @hurrycane Sunday, February 6, 2011