Almir m3nd3s                                                     http://www.almirmendes.com                               ...
Its me
http://www.flickr.com/photos/chealion/2349587639
http://www.flickr.com/photos/rdohms/4103026062
http://www.flickr.com/photos/hlegius/3544338710
Oi!
Por que mudar?
Agilidade            http://www.flickr.com/photos/eriwst/3448608210
10.times { |i| puts i }
10.class=> Fixnum
Dojo
http://reddevnews.com/articles/2007/11/01/testdriven-development-tdd.aspx
Continuous Integration
Ufa! Me                              Timelivrei dessa   Você quebrou                  o build?
Gambiarrashttp://www.flickr.com/photos/ricardo_ferreira/233163380/
<?phpecho “2Patos” +     “1Galinha” +     “2Codornas” == “5 Pássaros?”  // Acredite! Isto resulta em 1 (inteiro)?>
Mercado
Então, o que é o tal  Ruby on Rails?
http://www.flickr.com/photos/benmillett/306074038                         A web framework thats optimized for             ...
http://www.flickr.com/photos/arcticpuppy/4784727073It lets you write beautiful code byfavoring convention over configurati...
http://www.codinguide.com/2010/04/mvc-pattern.htmlMVC
Exemplo  Imagine que eu precise gerenciarusuários, estes teriam apenas nome e                e-mail.
Instala a gem rails$ gem install rails$ rails new meu_projeto     Cria um novo projeto
$ cd meu_projeto$ rails g model usuario nome:stringemail:string
class CreateUsuarios < ActiveRecord::Migration  def self.up        create_table :usuarios do |t|           t.string nome  ...
$ rake db:migrate                    Migration
Modelclass Usuario < ActiveRecord::Baseend                        app/models/usuario.rb
Modelu.save?()                    Usuario.allu.update_attributes()    Usuario.last(5)u.destroy()             Usuario.find(...
Controllerclass UsuariosController < ApplicationController      def index            @usuarios = Usuario.all      endend  ...
View   <ul>       <% @usuarios.each do |u| %>          <%= u.nome %>       <% end %>   </ul>                              ...
Gems       http://rubygems.org/       http://rubygems.org/
Por onde começar?
http://railsforzombies.org/http://railsforzombies.org/
http://rubyonrails.org/screencasts/rails3http://rubyonrails.org/screencasts/rails3
http://railscasts.com/http://railscasts.com/
http://guides.rubyonrails.org/http://guides.rubyonrails.org/
RailsRumble
www.rockandrails.com.br                          Realização
Almir m3nd3s@m3nd3shttp://www.almirmendes.comalmir.mendes@giran.com.br
Palestra "Do PHP ao Rails" - FOCAI
Palestra "Do PHP ao Rails" - FOCAI
Palestra "Do PHP ao Rails" - FOCAI
Palestra "Do PHP ao Rails" - FOCAI
Upcoming SlideShare
Loading in …5
×

Palestra "Do PHP ao Rails" - FOCAI

1,002 views
941 views

Published on

Palestra

Published in: Technology, Sports
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,002
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Palestra "Do PHP ao Rails" - FOCAI

  1. 1. Almir m3nd3s http://www.almirmendes.com m3nd3s@gmail.comhttp://www.flickr.com/photos/bellalago/4874839499/ http://www.flickr.com/photos/tswicegood/3483353187
  2. 2. Its me
  3. 3. http://www.flickr.com/photos/chealion/2349587639
  4. 4. http://www.flickr.com/photos/rdohms/4103026062
  5. 5. http://www.flickr.com/photos/hlegius/3544338710
  6. 6. Oi!
  7. 7. Por que mudar?
  8. 8. Agilidade http://www.flickr.com/photos/eriwst/3448608210
  9. 9. 10.times { |i| puts i }
  10. 10. 10.class=> Fixnum
  11. 11. Dojo
  12. 12. http://reddevnews.com/articles/2007/11/01/testdriven-development-tdd.aspx
  13. 13. Continuous Integration
  14. 14. Ufa! Me Timelivrei dessa Você quebrou o build?
  15. 15. Gambiarrashttp://www.flickr.com/photos/ricardo_ferreira/233163380/
  16. 16. <?phpecho “2Patos” + “1Galinha” + “2Codornas” == “5 Pássaros?” // Acredite! Isto resulta em 1 (inteiro)?>
  17. 17. Mercado
  18. 18. Então, o que é o tal Ruby on Rails?
  19. 19. http://www.flickr.com/photos/benmillett/306074038 A web framework thats optimized for programmer happiness and sustainable productivity.
  20. 20. http://www.flickr.com/photos/arcticpuppy/4784727073It lets you write beautiful code byfavoring convention over configuration.
  21. 21. http://www.codinguide.com/2010/04/mvc-pattern.htmlMVC
  22. 22. Exemplo Imagine que eu precise gerenciarusuários, estes teriam apenas nome e e-mail.
  23. 23. Instala a gem rails$ gem install rails$ rails new meu_projeto Cria um novo projeto
  24. 24. $ cd meu_projeto$ rails g model usuario nome:stringemail:string
  25. 25. class CreateUsuarios < ActiveRecord::Migration def self.up create_table :usuarios do |t| t.string nome t.string email t.timestamps end dnd def self.down drop_table :usuariosend end Migration
  26. 26. $ rake db:migrate Migration
  27. 27. Modelclass Usuario < ActiveRecord::Baseend app/models/usuario.rb
  28. 28. Modelu.save?() Usuario.allu.update_attributes() Usuario.last(5)u.destroy() Usuario.find(12)u.valid?() Usuario.newu.errors Usuario.queryu.new_record? Usuario.first()u.meu_atributo_x E muito mais...
  29. 29. Controllerclass UsuariosController < ApplicationController def index @usuarios = Usuario.all endend app/controllers/usuarios_controller.rb
  30. 30. View <ul> <% @usuarios.each do |u| %> <%= u.nome %> <% end %> </ul> Action app/views/usuarios/index.html.rb
  31. 31. Gems http://rubygems.org/ http://rubygems.org/
  32. 32. Por onde começar?
  33. 33. http://railsforzombies.org/http://railsforzombies.org/
  34. 34. http://rubyonrails.org/screencasts/rails3http://rubyonrails.org/screencasts/rails3
  35. 35. http://railscasts.com/http://railscasts.com/
  36. 36. http://guides.rubyonrails.org/http://guides.rubyonrails.org/
  37. 37. RailsRumble
  38. 38. www.rockandrails.com.br Realização
  39. 39. Almir m3nd3s@m3nd3shttp://www.almirmendes.comalmir.mendes@giran.com.br

×