Your SlideShare is downloading. ×
Repensando o Desenvolvimento Web com Ruby on Rails
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Repensando o Desenvolvimento Web com Ruby on Rails

717
views

Published on

Palestra proferida no Software Freedom Day / SE - 2009

Palestra proferida no Software Freedom Day / SE - 2009

Published in: Technology

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
717
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
20
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Transcript

    • 1. Repensando o Desenvolvimento Web com Ruby on Rails
    • 2. Rails
    • 3. Comunidade
    • 4. Filosofia
    • 5. DanteRegis.com @danteregis Admin de Redes - TJ/SE
    • 6. DanteRegis.com @danteregis Admin de Redes - TJ/SE http://slideshare.net/danteregis
    • 7. Você não vai aprender Ruby on Rails aqui
    • 8. framework
    • 9. David Heinemeier Hansson 2004
    • 10. 37signals
    • 11. 1400+ desenvolvedores
    • 12. jul/2004 0.5 dez/2005 1.0 mar/2006 1.1 jan/2007 1.2 dez/2007 2.0 jun/2008 2.1 nov/2008 2.2 mar/2009 2.3 algum dia (em 2009?) 3.0
    • 13. Empregos (fonte: indeed.com)
    • 14. MVC
    • 15. opiniated
    • 16. eXtreme Programming
    • 17. TDD
    • 18. REST
    • 19. modularização
    • 20. DRY
    • 21. Convention over Configuration
    • 22. KISS
    • 23. script/console
    • 24. Model
    • 25. Model
    • 26. Model
    • 27. Model id: integer name: string price: float category_id: integer stock: integer created_at: datetime updated_at: datetime
    • 28. Model id: integer name: string x = Product.new price: float category_id: integer stock: integer created_at: datetime updated_at: datetime
    • 29. Model id: integer name: string x = Product.new price: float x.name = "Pão Jacó" category_id: integer stock: integer created_at: datetime updated_at: datetime
    • 30. Model id: integer name: string x = Product.new price: float x.name = "Pão Jacó" category_id: integer x.stock = "100 stock: integer created_at: datetime updated_at: datetime
    • 31. Model id: integer name: string x = Product.new price: float x.name = "Pão Jacó" category_id: integer x.stock = "100 stock: integer x.price = 0.15 created_at: datetime updated_at: datetime
    • 32. Model id: integer name: string x = Product.new price: float x.name = "Pão Jacó" category_id: integer x.stock = "100 stock: integer x.price = 0.15 created_at: datetime x.save updated_at: datetime
    • 33. Model
    • 34. Model INSERT INTO `products` COLUMNS (`name`, `price`, `stock`) VALUES ("Pão Jaco", 0.15, 100);
    • 35. Model
    • 36. Model Product.first
    • 37. Model Product.first Product.find_all_by_category_id(10)
    • 38. Model Product.first Product.find_all_by_category_id(10) Product.find_or_create_by_name("Margarina")
    • 39. Model Product.first Product.find_all_by_category_id(10) Product.find_or_create_by_name("Margarina") Product.count
    • 40. Model Product.first Product.find_all_by_category_id(10) Product.find_or_create_by_name("Margarina") Product.count Product.average('price')
    • 41. validations
    • 42. associations
    • 43. instance methods
    • 44. Model class Product < ActiveRecord::Base end
    • 45. Model class Product < ActiveRecord::Base end
    • 46. Model class Product < ActiveRecord::Base belongs_to :category end
    • 47. Model class Product < ActiveRecord::Base belongs_to :category validates_presence_of :name end
    • 48. Model class Product < ActiveRecord::Base belongs_to :category validates_presence_of :name validates_numericality_of :stock end
    • 49. Model class Product < ActiveRecord::Base belongs_to :category validates_presence_of :name validates_numericality_of :stock def consume! stock -= 1 save end end
    • 50. p = Product.new(:stock => "xxxxx")
    • 51. p = Product.new(:stock => "xxxxx") p.save
    • 52. p = Product.new(:stock => "xxxxx") p.save #=> false
    • 53. p = Product.first p.category p.category.name = "Mudei o nome" p.category.save
    • 54. has_many
    • 55. class Category < ActiveRecord::Base has_many :products end
    • 56. cat.products cat.products.new cat.products.first
    • 57. named scope
    • 58. class Product < ActiveRecord::Base named_scope :low_stock, :conditions => ['stock <= 10'] end
    • 59. Product.low_stock #=> [.....]
    • 60. Product.low_stock #=> [.....] category.products.low_stock #=> [...]
    • 61. SQL?
    • 62. migrations
    • 63. controle de versão
    • 64. do banco de dados!
    • 65. sem SQL!
    • 66. class AddQuantityToCartProduct < ActiveRecord::Migration
    • 67. class AddQuantityToCartProduct < ActiveRecord::Migration def self.up add_column :cart_products, :quantity, :integer end
    • 68. class AddQuantityToCartProduct < ActiveRecord::Migration def self.up add_column :cart_products, :quantity, :integer end def self.down drop_column :cart_products, :quantity end end
    • 69. com SQL!
    • 70. > 90% experiência pessoal
    • 71. ActionController
    • 72. session
    • 73. render
    • 74. filters
    • 75. class ApplicationController < ActionController::Base before_filter :check_login def check_login render :text => "acesso negado!" end end
    • 76. flash
    • 77. flash[:notice] = "Você logou no sistema"
    • 78. cookies
    • 79. respond_to
    • 80. ActionView
    • 81. erb
    • 82. haml
    • 83. erb
    • 84. form_tag form_for
    • 85. <div> <span><%= flash[:notice] %></span> </div> <div> <% form_tag do %> <p> Usuário: <%= text_field_tag 'username' %> </p> <p> Senha: <%= password_field_tag 'password' %> </p> <p> <%= submit_tag 'Entrar' %> </p> <% end %> </div>
    • 86. Tempo para falar mal de certas “soluções”
    • 87. Fim do tempo para falar mal de certas “soluções”
    • 88. Comunidade
    • 89. RailsConf http://railsconf.com
    • 90. Rails Summit Latin America http://railssummit.com.br
    • 91. 13 e 14 de outubro São Paulo/SP
    • 92. Aldo França
    • 93. Great Blogs ‘n People
    • 94. Akita on Rails http://akitaonrails.com
    • 95. Carlos Brando http://nomedojogo.com
    • 96. Ozéias Sant’ana http://railsbox.org
    • 97. Bruno Miranda http://brunomiranda.com
    • 98. Ruby Onda http://rubyonda.com
    • 99. Nando Vieira http://simplesideias.com.br
    • 100. PeepCode http://peepcode.com
    • 101. RailsCasts http://railscasts.com
    • 102. http://slideshare.net/danteregis
    • 103. dante@danteregis.com

    ×