Don't wait for the "Questions?" slide
Boris Dinkevich CEO of 500Tech hackademy.co.il meetup.com/AngularJS-IL Among our clients: - Wix - Cellebrite - Autodesk - ...
A Web development framework based on the Ruby programming language The Zend to PHP The Spring to Java The ASP.NET to #C
Fast Easy Fun ?
Scalable ? Performant ? Development speed ?
C++ ? Caching Optimizations Parallelizm caches_page :index def index # Generate Item's index page end All available items: <ul> <li> </li> </ul>
Quality over quantity Full tests Platform integration Ready for everything
> Item.active.first.user.name 'Boris' class Item < ActiveRecord::Base belongs_to :user validates :desc, presence: { message: 'Please fill this out' }, length: { minimum: 4, maximum: 255 } scope :active, lambda { where(state: 'active') } has_paper_trail end Sample test The code
> User.create(email: 'boris@500tech.com', name: 'Boris') true > User.where(created_at: [1.week.ago..Date.today]).count 102 > User.verified.last.items.count 1 > User.pluck(:email) ['boris@500tech.com', 'adam@500tech.com', ...]
No DDL No SQL "scripts" Same for every developer Same for production class AddEmailToUsers < ActiveRe cord::Migration def up add_column :users, :email, :text add_index :users, :email end def down remove_column :users, :email remove_index :users, :email end end
Authorization Authentication Glue DB to HTML
Full CRUD controller Index, Show, Edit, Create, New, Update, Destroy def index @items = Item.all() end def show @item = Item.find(params[:id]) end def create @item = Item.new(params[:id]) if @item.save() .... class ItemsController < InheritedResources::Base end
Now with XML and JSON support class ItemsController < InheritedResources::Base respond_to :html, :xml, :json end |- app Directory structure |- views |- items |- index.html.erb |- show.html.erb |- index.json.jbuilder |- show.xml.erb
Now with Authorization and Authentication def index @items = Items.all end def index @items = @current_user.items.all end class ItemsController < InheritedResources::Base respond_to :html, :xml, :json protected def begin_of_association_chain @current_user end end Secure:
HAML SLIM Partials JSON Builder XML Builder PDF Builder etc
Compile CoffeeScript Compile SASS/LESS Minify JavaScript Minify CSS Version JS & CSS
describe 'create' do before do post(:create, params) end context 'missing username' do let(:params) { { username: '', password: 'somepass' } } it { expect(response.status).to eq(400) } it { expect(response.body).to eq('Missing credentials') } end end
VCR describe "create", vcr: { cassette_name: "facebook-login" } do Faker before do post(:create, params) end ... > Faker::Internet.email "eliza@mann.net" > Faker::Avatar.image "http://robohash.org/sitsequiquia.png?size=300x300"
Nope.
Medic / Doctor
@500TechIL blog.500tech.com meetup.com/angularjs-il meetup.com/hackademy hackademy.co.il

Why ruby on rails

  • 2.
    Don't wait forthe "Questions?" slide
  • 4.
    Boris Dinkevich CEOof 500Tech hackademy.co.il meetup.com/AngularJS-IL Among our clients: - Wix - Cellebrite - Autodesk - ...
  • 5.
    A Web developmentframework based on the Ruby programming language The Zend to PHP The Spring to Java The ASP.NET to #C
  • 6.
  • 7.
    Scalable ? Performant? Development speed ?
  • 9.
    C++ ? Caching Optimizations Parallelizm caches_page :index def index # Generate Item's index page end All available items: <ul> <li> </li> </ul>
  • 11.
    Quality over quantity Full tests Platform integration Ready for everything
  • 14.
    > Item.active.first.user.name 'Boris' class Item < ActiveRecord::Base belongs_to :user validates :desc, presence: { message: 'Please fill this out' }, length: { minimum: 4, maximum: 255 } scope :active, lambda { where(state: 'active') } has_paper_trail end Sample test The code
  • 15.
    > User.create(email: 'boris@500tech.com',name: 'Boris') true > User.where(created_at: [1.week.ago..Date.today]).count 102 > User.verified.last.items.count 1 > User.pluck(:email) ['boris@500tech.com', 'adam@500tech.com', ...]
  • 16.
    No DDL NoSQL "scripts" Same for every developer Same for production class AddEmailToUsers < ActiveRe cord::Migration def up add_column :users, :email, :text add_index :users, :email end def down remove_column :users, :email remove_index :users, :email end end
  • 17.
  • 19.
    Full CRUD controller Index, Show, Edit, Create, New, Update, Destroy def index @items = Item.all() end def show @item = Item.find(params[:id]) end def create @item = Item.new(params[:id]) if @item.save() .... class ItemsController < InheritedResources::Base end
  • 20.
    Now with XMLand JSON support class ItemsController < InheritedResources::Base respond_to :html, :xml, :json end |- app Directory structure |- views |- items |- index.html.erb |- show.html.erb |- index.json.jbuilder |- show.xml.erb
  • 21.
    Now with Authorizationand Authentication def index @items = Items.all end def index @items = @current_user.items.all end class ItemsController < InheritedResources::Base respond_to :html, :xml, :json protected def begin_of_association_chain @current_user end end Secure:
  • 22.
    HAML SLIM Partials JSON Builder XML Builder PDF Builder etc
  • 23.
    Compile CoffeeScript CompileSASS/LESS Minify JavaScript Minify CSS Version JS & CSS
  • 24.
    describe 'create' do before do post(:create, params) end context 'missing username' do let(:params) { { username: '', password: 'somepass' } } it { expect(response.status).to eq(400) } it { expect(response.body).to eq('Missing credentials') } end end
  • 25.
    VCR describe "create",vcr: { cassette_name: "facebook-login" } do Faker before do post(:create, params) end ... > Faker::Internet.email "eliza@mann.net" > Faker::Avatar.image "http://robohash.org/sitsequiquia.png?size=300x300"
  • 26.
  • 27.
  • 29.
    @500TechIL blog.500tech.com meetup.com/angularjs-il meetup.com/hackademy hackademy.co.il