SlideShare una empresa de Scribd logo
1 de 57
Introducción  a  Ruby On Rails Ing. Pablo Marrero
Agenda Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Introducción Ing. Pablo Marrero ,[object Object],[object Object],[object Object],Java Hibernate TopLink JPA EJB Spring Struts JSF Ruby on Rails
Introducción Ing. Pablo Marrero ,[object Object],[object Object],[object Object],Java Hibernate TopLink JPA EJB Spring Struts JSF Ruby on Rails Active Record Action Pack Action View Action Controller
Introducción Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Modelo Vista Controlador Browser BD
Introducción Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pilares de RoR Ruby Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pilares de RoR Ruby Ing. Pablo Marrero ,[object Object],[object Object],[object Object]
Pilares de RoR Ruby Ing. Pablo Marrero ,[object Object],[object Object],[object Object]
Pilares de RoR Ruby Ing. Pablo Marrero ,[object Object],variable_local @variable_de_instancia @@variable_de_clase $variable_global Clase CONSTANTE :simbolo metodo_de_instancia self.metodo_de_clase modifico_el_objeto! devuelvo_booleano?
Pilares de RoR Ruby Ing. Pablo Marrero Las estructuras  devuelven  el valor de la ultima expresión evaluada: @user = if params[:id] User.find(params[:id]) else User.new end
Pilares de RoR Ruby Ing. Pablo Marrero @post = Post.find(params[:id]) if @post @post.destroy end Mejor: if @post = Post.find(params[:id]) @post.destroy end
Pilares de RoR Ruby Ing. Pablo Marrero Asignaciones condicionales @title = "Tıtulo generico" unless defined?(@title) @title ||= "Tıtulo generico“ @heading = if defined?(@subsection) @subsection.title else @section.title end @heading = ( @subsection || @section ).title
Pilares de RoR Ruby Ing. Pablo Marrero Arrays @arr = [ 1, 2, 3, 4, 5 ] Iterando: @arr.each do |item| puts item end Que es el for de toda la vida: for item in @arr puts item end
Pilares de RoR Ruby Ing. Pablo Marrero Utilidades Varias para Arrays .uniq [1,1,2,3,3].uniq >> [1,2,3] .flatten [[1,1],2,[3,3]].flatten >> [1,1,2,3,3] .compact [1,nil,2,nil,3].compact >> [1,2,3] .reverse [1,1,2,3,3].reverse >> [3,3,2,1,1] .sort [1,3,2,1,3].sort >> [1,1,2,3,3] .find [1,2,3].find {|n| n % 3 == 0 } >> 3 [1,2,3].find {|n| n % 5 == 0 } >> nil .find_all [1,3,5,6].find_all {|n| n % 3 == 0 } >> [3,6] [1,2,3].find_all {|n| n % 5 == 0 } >> []
Pilares de RoR Ruby Ing. Pablo Marrero Que pasa con las clases? class Persona def nombre @nombre end def nombre=(nombre) @nombre = nombre end end No mas getter y setter!! class Persona attr_accesor :nombre, :apellido attr_reader :id attr_writer :notas end
Pilares de RoR Ruby Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],Yukihiro Matsumoto Often people, especially computer engineers, focus on the machines. They think, "By doing this, the machine will run faster. By doing this, the machine will run more efectively. By doing this, the machine will something something something."They are focusing on machines. But in fact we need to focus on humans, on how humans care about doing programming or operating the application of the machines. We are the masters. They are the slaves. ,[object Object]
Agenda Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pilares de RoR Convención sobre Configuración Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pilares de RoR Convención sobre Configuración Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object]
Agenda Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pilares de RoR Dont Repeat Yourself Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object]
Pilares de RoR Dont Repeat Yourself Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pilares de RoR Active Record Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pilares de RoR Active Record Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pilares de RoR Active Record Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pilares de RoR Active Record Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pilares de RoR Active Record Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pilares de RoR Active Record Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pilares de RoR Active Record Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pilares de RoR Active Record Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pilares de RoR Active Record Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pilares de RoR Active Record Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pilares de RoR Active Record Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pilares de RoR Migrations Ing. Pablo Marrero ,[object Object],[object Object],[object Object]
Pilares de RoR Migrations Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object]
Pilares de RoR Migrations Ing. Pablo Marrero ,[object Object],[object Object]
Pilares de RoR Migrations Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pilares de RoR Migrations Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pilares de RoR Migrations Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Pilares de RoR Migrations Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
A Codificar! Instalación de Ruby y RoR Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
A Codificar! Instalación de Ruby y RoR Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object]
A Codificar! Instalación de Ruby y RoR Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
A Codificar! Herramientas de Desarrollo Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Agenda Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
A Codificar! Mini Proyecto Ing. Pablo Marrero ,[object Object]
Recursos Web Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Libros Ing. Pablo Marrero ,[object Object],[object Object]
¿ Preguntas ? Ing. Pablo Marrero
Referencias Ing. Pablo Marrero ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Muchas Gracias! Ing. Pablo Marrero ,[object Object],[object Object]

Más contenido relacionado

Similar a Introducción a RubyOnRails

Meetup training Taller RoR
Meetup training Taller RoR Meetup training Taller RoR
Meetup training Taller RoR cdechauri
 
Presentacion Ruby on Rails en Universidad Autónoma 2009
Presentacion Ruby on Rails en Universidad Autónoma 2009Presentacion Ruby on Rails en Universidad Autónoma 2009
Presentacion Ruby on Rails en Universidad Autónoma 2009Nelson Rojas Núñez
 
Presentacion Ruby on Rails CTIC-Cusco2007
Presentacion Ruby on Rails CTIC-Cusco2007Presentacion Ruby on Rails CTIC-Cusco2007
Presentacion Ruby on Rails CTIC-Cusco2007JuancaPompilla
 
Retos en la Adopción del Refactoring - Junta General del MexALN 28/06/2012
Retos en la Adopción del Refactoring - Junta General del MexALN 28/06/2012Retos en la Adopción del Refactoring - Junta General del MexALN 28/06/2012
Retos en la Adopción del Refactoring - Junta General del MexALN 28/06/2012Alfredo Chavez
 
Taller evento TestingUY 2016 - Automatización de Pruebas con Ruby
Taller evento TestingUY 2016 - Automatización de Pruebas con RubyTaller evento TestingUY 2016 - Automatización de Pruebas con Ruby
Taller evento TestingUY 2016 - Automatización de Pruebas con RubyTestingUy
 
Ruby on the Rails
Ruby on the RailsRuby on the Rails
Ruby on the Rails000ari2014
 
Ruby On Rails Jun2009
Ruby On Rails Jun2009Ruby On Rails Jun2009
Ruby On Rails Jun2009Sergio Alonso
 
Introduccion A Php
Introduccion A PhpIntroduccion A Php
Introduccion A Phputs
 
Introduccion A Php
Introduccion A PhpIntroduccion A Php
Introduccion A Phputs
 
Introduccion A Php
Introduccion A PhpIntroduccion A Php
Introduccion A Phputs
 
Ruby on Rails - ETyC 2011
Ruby on Rails - ETyC 2011Ruby on Rails - ETyC 2011
Ruby on Rails - ETyC 2011Rafael Franco
 
Desarrollo de Aplicaciones con Ruby on Rails y PostgreSQL
Desarrollo de Aplicaciones con Ruby on Rails y PostgreSQLDesarrollo de Aplicaciones con Ruby on Rails y PostgreSQL
Desarrollo de Aplicaciones con Ruby on Rails y PostgreSQLJosé Alfredo Ramírez
 
Ruby es un lenguaje de programación interpretado
Ruby es un lenguaje de programación interpretadoRuby es un lenguaje de programación interpretado
Ruby es un lenguaje de programación interpretadoYulgrecia2011
 
5 tips para programar en Ruby On Rails
5 tips para programar en Ruby On Rails 5 tips para programar en Ruby On Rails
5 tips para programar en Ruby On Rails kyaalena
 
Programacion web
Programacion webProgramacion web
Programacion webIACSA
 
Conceptos básicos y aplicaciones prácticas de programación para SEO
Conceptos básicos y aplicaciones prácticas de programación para SEOConceptos básicos y aplicaciones prácticas de programación para SEO
Conceptos básicos y aplicaciones prácticas de programación para SEOnacho mascort
 

Similar a Introducción a RubyOnRails (20)

Python django
Python djangoPython django
Python django
 
Meetup training Taller RoR
Meetup training Taller RoR Meetup training Taller RoR
Meetup training Taller RoR
 
Grails barcamp 2013
Grails barcamp 2013Grails barcamp 2013
Grails barcamp 2013
 
Presentacion Ruby on Rails en Universidad Autónoma 2009
Presentacion Ruby on Rails en Universidad Autónoma 2009Presentacion Ruby on Rails en Universidad Autónoma 2009
Presentacion Ruby on Rails en Universidad Autónoma 2009
 
Presentacion Ruby on Rails CTIC-Cusco2007
Presentacion Ruby on Rails CTIC-Cusco2007Presentacion Ruby on Rails CTIC-Cusco2007
Presentacion Ruby on Rails CTIC-Cusco2007
 
Retos en la Adopción del Refactoring - Junta General del MexALN 28/06/2012
Retos en la Adopción del Refactoring - Junta General del MexALN 28/06/2012Retos en la Adopción del Refactoring - Junta General del MexALN 28/06/2012
Retos en la Adopción del Refactoring - Junta General del MexALN 28/06/2012
 
Taller evento TestingUY 2016 - Automatización de Pruebas con Ruby
Taller evento TestingUY 2016 - Automatización de Pruebas con RubyTaller evento TestingUY 2016 - Automatización de Pruebas con Ruby
Taller evento TestingUY 2016 - Automatización de Pruebas con Ruby
 
Java jaucito
Java jaucitoJava jaucito
Java jaucito
 
Ruby on the Rails
Ruby on the RailsRuby on the Rails
Ruby on the Rails
 
Ruby On Rails Jun2009
Ruby On Rails Jun2009Ruby On Rails Jun2009
Ruby On Rails Jun2009
 
Introduccion A Php
Introduccion A PhpIntroduccion A Php
Introduccion A Php
 
Introduccion A Php
Introduccion A PhpIntroduccion A Php
Introduccion A Php
 
Introduccion A Php
Introduccion A PhpIntroduccion A Php
Introduccion A Php
 
Ruby on Rails - ETyC 2011
Ruby on Rails - ETyC 2011Ruby on Rails - ETyC 2011
Ruby on Rails - ETyC 2011
 
Desarrollo de Aplicaciones con Ruby on Rails y PostgreSQL
Desarrollo de Aplicaciones con Ruby on Rails y PostgreSQLDesarrollo de Aplicaciones con Ruby on Rails y PostgreSQL
Desarrollo de Aplicaciones con Ruby on Rails y PostgreSQL
 
Ruby es un lenguaje de programación interpretado
Ruby es un lenguaje de programación interpretadoRuby es un lenguaje de programación interpretado
Ruby es un lenguaje de programación interpretado
 
5 tips para programar en Ruby On Rails
5 tips para programar en Ruby On Rails 5 tips para programar en Ruby On Rails
5 tips para programar en Ruby On Rails
 
Programacion web
Programacion webProgramacion web
Programacion web
 
FULLSTACK JS DEV in 2017
FULLSTACK JS DEV in 2017FULLSTACK JS DEV in 2017
FULLSTACK JS DEV in 2017
 
Conceptos básicos y aplicaciones prácticas de programación para SEO
Conceptos básicos y aplicaciones prácticas de programación para SEOConceptos básicos y aplicaciones prácticas de programación para SEO
Conceptos básicos y aplicaciones prácticas de programación para SEO
 

Último

La era de la educación digital y sus desafios
La era de la educación digital y sus desafiosLa era de la educación digital y sus desafios
La era de la educación digital y sus desafiosFundación YOD YOD
 
dokumen.tips_36274588-sistema-heui-eui.ppt
dokumen.tips_36274588-sistema-heui-eui.pptdokumen.tips_36274588-sistema-heui-eui.ppt
dokumen.tips_36274588-sistema-heui-eui.pptMiguelAtencio10
 
PARTES DE UN OSCILOSCOPIO ANALOGICO .pdf
PARTES DE UN OSCILOSCOPIO ANALOGICO .pdfPARTES DE UN OSCILOSCOPIO ANALOGICO .pdf
PARTES DE UN OSCILOSCOPIO ANALOGICO .pdfSergioMendoza354770
 
Cortes-24-de-abril-Tungurahua-3 año 2024
Cortes-24-de-abril-Tungurahua-3 año 2024Cortes-24-de-abril-Tungurahua-3 año 2024
Cortes-24-de-abril-Tungurahua-3 año 2024GiovanniJavierHidalg
 
Hernandez_Hernandez_Practica web de la sesion 12.pptx
Hernandez_Hernandez_Practica web de la sesion 12.pptxHernandez_Hernandez_Practica web de la sesion 12.pptx
Hernandez_Hernandez_Practica web de la sesion 12.pptxJOSEMANUELHERNANDEZH11
 
Actividad integradora 6 CREAR UN RECURSO MULTIMEDIA
Actividad integradora 6    CREAR UN RECURSO MULTIMEDIAActividad integradora 6    CREAR UN RECURSO MULTIMEDIA
Actividad integradora 6 CREAR UN RECURSO MULTIMEDIA241531640
 
El uso delas tic en la vida cotidiana MFEL
El uso delas tic en la vida cotidiana MFELEl uso delas tic en la vida cotidiana MFEL
El uso delas tic en la vida cotidiana MFELmaryfer27m
 
trabajotecologiaisabella-240424003133-8f126965.pdf
trabajotecologiaisabella-240424003133-8f126965.pdftrabajotecologiaisabella-240424003133-8f126965.pdf
trabajotecologiaisabella-240424003133-8f126965.pdfIsabellaMontaomurill
 
International Women's Day Sucre 2024 (IWD)
International Women's Day Sucre 2024 (IWD)International Women's Day Sucre 2024 (IWD)
International Women's Day Sucre 2024 (IWD)GDGSucre
 
Crear un recurso multimedia. Maricela_Ponce_DomingoM1S3AI6-1.pptx
Crear un recurso multimedia. Maricela_Ponce_DomingoM1S3AI6-1.pptxCrear un recurso multimedia. Maricela_Ponce_DomingoM1S3AI6-1.pptx
Crear un recurso multimedia. Maricela_Ponce_DomingoM1S3AI6-1.pptxNombre Apellidos
 
Redes direccionamiento y subredes ipv4 2024 .pdf
Redes direccionamiento y subredes ipv4 2024 .pdfRedes direccionamiento y subredes ipv4 2024 .pdf
Redes direccionamiento y subredes ipv4 2024 .pdfsoporteupcology
 
Presentación inteligencia artificial en la actualidad
Presentación inteligencia artificial en la actualidadPresentación inteligencia artificial en la actualidad
Presentación inteligencia artificial en la actualidadMiguelAngelVillanuev48
 
Plan de aula informatica segundo periodo.docx
Plan de aula informatica segundo periodo.docxPlan de aula informatica segundo periodo.docx
Plan de aula informatica segundo periodo.docxpabonheidy28
 
Medidas de formas, coeficiente de asimetría y coeficiente de curtosis.pptx
Medidas de formas, coeficiente de asimetría y coeficiente de curtosis.pptxMedidas de formas, coeficiente de asimetría y coeficiente de curtosis.pptx
Medidas de formas, coeficiente de asimetría y coeficiente de curtosis.pptxaylincamaho
 
definicion segun autores de matemáticas educativa
definicion segun autores de matemáticas  educativadefinicion segun autores de matemáticas  educativa
definicion segun autores de matemáticas educativaAdrianaMartnez618894
 
SalmorejoTech 2024 - Spring Boot <3 Testcontainers
SalmorejoTech 2024 - Spring Boot <3 TestcontainersSalmorejoTech 2024 - Spring Boot <3 Testcontainers
SalmorejoTech 2024 - Spring Boot <3 TestcontainersIván López Martín
 
KELA Presentacion Costa Rica 2024 - evento Protégeles
KELA Presentacion Costa Rica 2024 - evento ProtégelesKELA Presentacion Costa Rica 2024 - evento Protégeles
KELA Presentacion Costa Rica 2024 - evento ProtégelesFundación YOD YOD
 
El gusano informático Morris (1988) - Julio Ardita (1995) - Citizenfour (2014...
El gusano informático Morris (1988) - Julio Ardita (1995) - Citizenfour (2014...El gusano informático Morris (1988) - Julio Ardita (1995) - Citizenfour (2014...
El gusano informático Morris (1988) - Julio Ardita (1995) - Citizenfour (2014...JaquelineJuarez15
 
R1600G CAT Variables de cargadores en mina
R1600G CAT Variables de cargadores en minaR1600G CAT Variables de cargadores en mina
R1600G CAT Variables de cargadores en minaarkananubis
 
ejercicios pseint para aprogramacion sof
ejercicios pseint para aprogramacion sofejercicios pseint para aprogramacion sof
ejercicios pseint para aprogramacion sofJuancarlosHuertasNio1
 

Último (20)

La era de la educación digital y sus desafios
La era de la educación digital y sus desafiosLa era de la educación digital y sus desafios
La era de la educación digital y sus desafios
 
dokumen.tips_36274588-sistema-heui-eui.ppt
dokumen.tips_36274588-sistema-heui-eui.pptdokumen.tips_36274588-sistema-heui-eui.ppt
dokumen.tips_36274588-sistema-heui-eui.ppt
 
PARTES DE UN OSCILOSCOPIO ANALOGICO .pdf
PARTES DE UN OSCILOSCOPIO ANALOGICO .pdfPARTES DE UN OSCILOSCOPIO ANALOGICO .pdf
PARTES DE UN OSCILOSCOPIO ANALOGICO .pdf
 
Cortes-24-de-abril-Tungurahua-3 año 2024
Cortes-24-de-abril-Tungurahua-3 año 2024Cortes-24-de-abril-Tungurahua-3 año 2024
Cortes-24-de-abril-Tungurahua-3 año 2024
 
Hernandez_Hernandez_Practica web de la sesion 12.pptx
Hernandez_Hernandez_Practica web de la sesion 12.pptxHernandez_Hernandez_Practica web de la sesion 12.pptx
Hernandez_Hernandez_Practica web de la sesion 12.pptx
 
Actividad integradora 6 CREAR UN RECURSO MULTIMEDIA
Actividad integradora 6    CREAR UN RECURSO MULTIMEDIAActividad integradora 6    CREAR UN RECURSO MULTIMEDIA
Actividad integradora 6 CREAR UN RECURSO MULTIMEDIA
 
El uso delas tic en la vida cotidiana MFEL
El uso delas tic en la vida cotidiana MFELEl uso delas tic en la vida cotidiana MFEL
El uso delas tic en la vida cotidiana MFEL
 
trabajotecologiaisabella-240424003133-8f126965.pdf
trabajotecologiaisabella-240424003133-8f126965.pdftrabajotecologiaisabella-240424003133-8f126965.pdf
trabajotecologiaisabella-240424003133-8f126965.pdf
 
International Women's Day Sucre 2024 (IWD)
International Women's Day Sucre 2024 (IWD)International Women's Day Sucre 2024 (IWD)
International Women's Day Sucre 2024 (IWD)
 
Crear un recurso multimedia. Maricela_Ponce_DomingoM1S3AI6-1.pptx
Crear un recurso multimedia. Maricela_Ponce_DomingoM1S3AI6-1.pptxCrear un recurso multimedia. Maricela_Ponce_DomingoM1S3AI6-1.pptx
Crear un recurso multimedia. Maricela_Ponce_DomingoM1S3AI6-1.pptx
 
Redes direccionamiento y subredes ipv4 2024 .pdf
Redes direccionamiento y subredes ipv4 2024 .pdfRedes direccionamiento y subredes ipv4 2024 .pdf
Redes direccionamiento y subredes ipv4 2024 .pdf
 
Presentación inteligencia artificial en la actualidad
Presentación inteligencia artificial en la actualidadPresentación inteligencia artificial en la actualidad
Presentación inteligencia artificial en la actualidad
 
Plan de aula informatica segundo periodo.docx
Plan de aula informatica segundo periodo.docxPlan de aula informatica segundo periodo.docx
Plan de aula informatica segundo periodo.docx
 
Medidas de formas, coeficiente de asimetría y coeficiente de curtosis.pptx
Medidas de formas, coeficiente de asimetría y coeficiente de curtosis.pptxMedidas de formas, coeficiente de asimetría y coeficiente de curtosis.pptx
Medidas de formas, coeficiente de asimetría y coeficiente de curtosis.pptx
 
definicion segun autores de matemáticas educativa
definicion segun autores de matemáticas  educativadefinicion segun autores de matemáticas  educativa
definicion segun autores de matemáticas educativa
 
SalmorejoTech 2024 - Spring Boot <3 Testcontainers
SalmorejoTech 2024 - Spring Boot <3 TestcontainersSalmorejoTech 2024 - Spring Boot <3 Testcontainers
SalmorejoTech 2024 - Spring Boot <3 Testcontainers
 
KELA Presentacion Costa Rica 2024 - evento Protégeles
KELA Presentacion Costa Rica 2024 - evento ProtégelesKELA Presentacion Costa Rica 2024 - evento Protégeles
KELA Presentacion Costa Rica 2024 - evento Protégeles
 
El gusano informático Morris (1988) - Julio Ardita (1995) - Citizenfour (2014...
El gusano informático Morris (1988) - Julio Ardita (1995) - Citizenfour (2014...El gusano informático Morris (1988) - Julio Ardita (1995) - Citizenfour (2014...
El gusano informático Morris (1988) - Julio Ardita (1995) - Citizenfour (2014...
 
R1600G CAT Variables de cargadores en mina
R1600G CAT Variables de cargadores en minaR1600G CAT Variables de cargadores en mina
R1600G CAT Variables de cargadores en mina
 
ejercicios pseint para aprogramacion sof
ejercicios pseint para aprogramacion sofejercicios pseint para aprogramacion sof
ejercicios pseint para aprogramacion sof
 

Introducción a RubyOnRails

  • 1. Introducción a Ruby On Rails Ing. Pablo Marrero
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12. Pilares de RoR Ruby Ing. Pablo Marrero Las estructuras devuelven el valor de la ultima expresión evaluada: @user = if params[:id] User.find(params[:id]) else User.new end
  • 13. Pilares de RoR Ruby Ing. Pablo Marrero @post = Post.find(params[:id]) if @post @post.destroy end Mejor: if @post = Post.find(params[:id]) @post.destroy end
  • 14. Pilares de RoR Ruby Ing. Pablo Marrero Asignaciones condicionales @title = &quot;Tıtulo generico&quot; unless defined?(@title) @title ||= &quot;Tıtulo generico“ @heading = if defined?(@subsection) @subsection.title else @section.title end @heading = ( @subsection || @section ).title
  • 15. Pilares de RoR Ruby Ing. Pablo Marrero Arrays @arr = [ 1, 2, 3, 4, 5 ] Iterando: @arr.each do |item| puts item end Que es el for de toda la vida: for item in @arr puts item end
  • 16. Pilares de RoR Ruby Ing. Pablo Marrero Utilidades Varias para Arrays .uniq [1,1,2,3,3].uniq >> [1,2,3] .flatten [[1,1],2,[3,3]].flatten >> [1,1,2,3,3] .compact [1,nil,2,nil,3].compact >> [1,2,3] .reverse [1,1,2,3,3].reverse >> [3,3,2,1,1] .sort [1,3,2,1,3].sort >> [1,1,2,3,3] .find [1,2,3].find {|n| n % 3 == 0 } >> 3 [1,2,3].find {|n| n % 5 == 0 } >> nil .find_all [1,3,5,6].find_all {|n| n % 3 == 0 } >> [3,6] [1,2,3].find_all {|n| n % 5 == 0 } >> []
  • 17. Pilares de RoR Ruby Ing. Pablo Marrero Que pasa con las clases? class Persona def nombre @nombre end def nombre=(nombre) @nombre = nombre end end No mas getter y setter!! class Persona attr_accesor :nombre, :apellido attr_reader :id attr_writer :notas end
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55. ¿ Preguntas ? Ing. Pablo Marrero
  • 56.
  • 57.