Ruby on Rails
-
Upload
sergio-gil -
Category
Technology
-
view
1.825 -
download
3
description
Transcript of Ruby on Rails
![Page 1: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/1.jpg)
Ruby on RailsRazones por las que deberías tenerlo en tu
radar
Sergio Gil
![Page 2: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/2.jpg)
Ruby
![Page 3: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/3.jpg)
Ruby
![Page 4: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/4.jpg)
• Creado en Japón en los 90
Ruby
![Page 5: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/5.jpg)
• Creado en Japón en los 90• Interpretado
Ruby
![Page 6: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/6.jpg)
• Creado en Japón en los 90• Interpretado• Dinámico
Ruby
![Page 7: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/7.jpg)
• Creado en Japón en los 90• Interpretado• Dinámico• Orientado a objetos
Ruby
![Page 8: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/8.jpg)
• Creado en Japón en los 90• Interpretado• Dinámico• Orientado a objetos• Mola =;-)
Ruby
![Page 9: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/9.jpg)
5.timesdoputs'¡Fácil!'end
![Page 10: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/10.jpg)
5.timesdoputs'¡Fácil!'end
• Cercano a nuestra forma de pensar
![Page 11: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/11.jpg)
5.timesdoputs'¡Fácil!'end
• Cercano a nuestra forma de pensar• Lo cual da una experiencia mejor
![Page 12: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/12.jpg)
5.timesdoputs'¡Fácil!'end
• Cercano a nuestra forma de pensar• Lo cual da una experiencia mejor• Te hace sentir inteligente
![Page 13: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/13.jpg)
5.timesdoputs'¡Fácil!'end
• Cercano a nuestra forma de pensar• Lo cual da una experiencia mejor• Te hace sentir inteligente• ¡Es divertido!
![Page 14: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/14.jpg)
Rails
![Page 15: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/15.jpg)
Ruby on Rails
![Page 16: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/16.jpg)
• Framework de desarrollo web
Ruby on Rails
![Page 17: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/17.jpg)
• Framework de desarrollo web• Creado por David Heinemeier Hanson
(37signals)
Ruby on Rails
![Page 18: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/18.jpg)
• Framework de desarrollo web• Creado por David Heinemeier Hanson
(37signals)• Extraído de su aplicación Basecamp
Ruby on Rails
![Page 19: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/19.jpg)
• Framework de desarrollo web• Creado por David Heinemeier Hanson
(37signals)• Extraído de su aplicación Basecamp• Liberado en 2005
Ruby on Rails
![Page 20: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/20.jpg)
Colección de patrones resueltos
¿Cuántas veces has hecho...
![Page 21: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/21.jpg)
Colección de patrones resueltos
¿Cuántas veces has hecho...
![Page 22: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/22.jpg)
Colección de patrones resueltos
¿Cuántas veces has hecho...
![Page 23: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/23.jpg)
Colección de patrones resueltos
¿Cuántas veces has hecho...
![Page 24: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/24.jpg)
Colección de patrones resueltos
¿Cuántas veces has hecho...
![Page 25: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/25.jpg)
Colección de patrones resueltos
¿Cuántas veces has hecho...
![Page 26: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/26.jpg)
Framework “con opinión”
Hacer fácil lo correcto...
...y difícil lo incorrecto
“si es feo, probablemente está mal”
![Page 27: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/27.jpg)
![Page 28: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/28.jpg)
![Page 29: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/29.jpg)
![Page 30: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/30.jpg)
![Page 31: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/31.jpg)
![Page 32: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/32.jpg)
![Page 33: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/33.jpg)
![Page 34: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/34.jpg)
La Comunidad
![Page 35: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/35.jpg)
ModeloVista
Controlador
MVC
![Page 36: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/36.jpg)
![Page 37: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/37.jpg)
Convention Over Configuration
![Page 38: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/38.jpg)
Convención: norma sin efecto real directo, salvo el beneficio que se obtiene de que todos
los agentes la sigan
![Page 39: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/39.jpg)
![Page 40: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/40.jpg)
classUser<ActiveRecord::Base
has_many:articles,:class_name=>"Article"end
classArticle<ActiveRecord::Base
belongs_to:user,:class_name=>"User"end
classUser<ActiveRecord::Baseset_table_name"users"
has_many:articles,:class_name=>"Article",:foreign_key=>"user_id"end
classArticle<ActiveRecord::Baseset_table_name"articles"
belongs_to:user,:class_name=>"User",:foreign_key=>"user_id"end
classUser<ActiveRecord::Baseset_table_name"users"set_primary_key"id"has_many:articles,:class_name=>"Article",:foreign_key=>"user_id"end
classArticle<ActiveRecord::Baseset_table_name"articles"set_primary_key"id"belongs_to:user,:class_name=>"User",:foreign_key=>"user_id"end
classUser<ActiveRecord::Base
has_many:articles,:class_name=>"Article",:foreign_key=>"user_id"end
classArticle<ActiveRecord::Base
belongs_to:user,:class_name=>"User",:foreign_key=>"user_id"end
classUser<ActiveRecord::Base
has_many:articlesend
classArticle<ActiveRecord::Base
belongs_to:userend
![Page 41: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/41.jpg)
classUser<ActiveRecord::Base
has_many:articles,:class_name=>"Article"end
classArticle<ActiveRecord::Base
belongs_to:user,:class_name=>"User"end
classUser<ActiveRecord::Baseset_table_name"users"
has_many:articles,:class_name=>"Article",:foreign_key=>"user_id"end
classArticle<ActiveRecord::Baseset_table_name"articles"
belongs_to:user,:class_name=>"User",:foreign_key=>"user_id"end
classUser<ActiveRecord::Base
has_many:articles,:class_name=>"Article",:foreign_key=>"user_id"end
classArticle<ActiveRecord::Base
belongs_to:user,:class_name=>"User",:foreign_key=>"user_id"end
classUser<ActiveRecord::Base
has_many:articlesend
classArticle<ActiveRecord::Base
belongs_to:userend
![Page 42: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/42.jpg)
classUser<ActiveRecord::Base
has_many:articles,:class_name=>"Article"end
classArticle<ActiveRecord::Base
belongs_to:user,:class_name=>"User"end
classUser<ActiveRecord::Base
has_many:articles,:class_name=>"Article",:foreign_key=>"user_id"end
classArticle<ActiveRecord::Base
belongs_to:user,:class_name=>"User",:foreign_key=>"user_id"end
classUser<ActiveRecord::Base
has_many:articlesend
classArticle<ActiveRecord::Base
belongs_to:userend
![Page 43: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/43.jpg)
classUser<ActiveRecord::Base
has_many:articles,:class_name=>"Article"end
classArticle<ActiveRecord::Base
belongs_to:user,:class_name=>"User"end
classUser<ActiveRecord::Base
has_many:articlesend
classArticle<ActiveRecord::Base
belongs_to:userend
![Page 44: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/44.jpg)
classUser<ActiveRecord::Base
has_many:articlesend
classArticle<ActiveRecord::Base
belongs_to:userend
![Page 45: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/45.jpg)
classUser<ActiveRecord::Base
has_many:articlesend
classArticle<ActiveRecord::Base
belongs_to:userend
classUser<ActiveRecord::Basehas_many:articlesend
classArticle<ActiveRecord::Basebelongs_to:userend
![Page 46: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/46.jpg)
classUser<ActiveRecord::Basehas_many:articlesend
classArticle<ActiveRecord::Basebelongs_to:userend
![Page 47: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/47.jpg)
Don’t Repeat Yourself
![Page 48: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/48.jpg)
ActionController::Routing::Routes.drawdo|map|map.article':year/:title',:controller=>'articles',:action=>'show'map.connect':controller/:action/:id'end
link_to(article.title,article_url(:year=>article.date.year,:title=>article.title))
config/routes.rb
app/views/articles/index.rhtml
<ahref="/2007/rails">rails</a>
![Page 49: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/49.jpg)
Y además
![Page 50: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/50.jpg)
![Page 51: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/51.jpg)
Testing integrado
![Page 52: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/52.jpg)
Testing integradoPlugins
![Page 53: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/53.jpg)
Testing integradoPlugins
Migraciones
![Page 54: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/54.jpg)
Testing integradoPlugins
MigracionesORM avanzado
![Page 55: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/55.jpg)
Testing integradoPlugins
MigracionesORM avanzado
REST
![Page 56: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/56.jpg)
Testing integradoPlugins
MigracionesORM avanzado
RESTAJAX
![Page 57: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/57.jpg)
Testing integradoPlugins
MigracionesORM avanzado
RESTAJAX
Capistrano
![Page 58: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/58.jpg)
¡Me apunto!
![Page 60: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/60.jpg)
Lista de correo en español
http://lists.simplelogica.net/mailman/listinfo/ror‐es
![Page 61: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/61.jpg)
![Page 62: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/62.jpg)
Conferencia Rails Hispana ‘2007
Madrid, 22 y 23 de noviembre
http://www.conferenciarails.org/
![Page 63: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/63.jpg)
Entonces, ¿Rails es la solución a todos
los problemas?
![Page 64: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/64.jpg)
NO
![Page 65: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/65.jpg)
NOPero sí una herramienta útil
para muchos; tenla en tu arsenal y úsala cuando
corresponda
![Page 66: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/66.jpg)
¿Y escala?
![Page 67: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/67.jpg)
Sí.
![Page 68: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/68.jpg)
¿Preguntas?
![Page 69: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/69.jpg)
Muchas graciassergio.gil@the‐cocktail.com
lacoctelera.com/porras
the‐cocktail.com
![Page 70: Ruby on Rails](https://reader033.fdocument.pub/reader033/viewer/2022061221/54bd17664a7959f95e8b459c/html5/thumbnails/70.jpg)
Créditos fotográficosLars Kristian Flem (http://www.flickr.com/photos/larskflem/46551303/) (CC)Michel Kuik (http://www.flickr.com/photos/michelkuik/161160973/) (CC)Ale Muñoz (http://www.sofanaranja.com/)Brillantine Sánchez (http://www.flickr.com/photos/brilliantly/534331230)Robert Parviainen (http://flickr.com/photos/rtv/290062998/) (CC)Sean Dwyer (http://www.flickr.com/photos/dwired/1414217985/) (CC)