300 likes | 452 Views
Ruby on Rails : An introduction - Who am I?. RoR : An introduction . Presented b y :. Maciej Mensfeld. senior ruby developer@araneo.pl lead ruby developer@wordwatch.com. maciej@mensfeld.pl dev.mensfeld.pl github.com / mensfeld. Maciej Mensfeld.
E N D
Ruby on Rails: An introduction - Whoam I? RoR: An introduction Presented by: Maciej Mensfeld senior rubydeveloper@araneo.pl leadruby developer@wordwatch.com maciej@mensfeld.pl dev.mensfeld.pl github.com/mensfeld Maciej Mensfeld
Ruby on Rails: An introduction - Rules RoR: An introduction Please… • …ask me to slow down, if I speak to quickly; • …ask me again, if I forget; • …askquestions, ifanything i sayis not clear; • …feelfree to shareyourownobservations Maciej Mensfeld 2/30
Ruby on Rails: An introduction – Railswhat? RoR: An introduction Maciej Mensfeld 3/30
Ruby on Rails: An introduction – Whatis Ruby on Rails? RoR: Whatis Ruby on Rails? • Full stack web application framework • Written in the Ruby programming language • Growing community since 2004 • Open Source and Free • Focused on developer productivity and getting thejob done – fast! Maciej Mensfeld 4/30
Ruby on Rails: An introduction – Whatis Ruby on Rails? RoR: Why Ruby on Rails? Lot of frameworks exists on the market and a lot of programming languages for the web but… Rails leads Maciej Mensfeld 5/30
Ruby on Rails: An introduction – Whatis Ruby on Rails? RoR: Why Ruby on Rails? • Rails give the developers a real productivity boost fordeveloping web applications • Because of Ruby and domain specific languages • Convention over Configuration • Productivityboost! 3-4 timesfasterthandevwithzend Reallyfaster? Maciej Mensfeld 6/30
Ruby on Rails: An introduction – Whatis Ruby on Rails? RoR: Why Ruby on Rails? Designed to make it easier to develop, deploy, and maintain web applications Design with Model-View-Controller Also based on DRY concept Don’t Repeat Yourself (DRY) Every piece of knowledge should be expressed in just one place Maciej Mensfeld 7/30
Ruby on Rails: An introduction – WhousesRoR? I do! ;) (but not only…) and thousands of other… Maciej Mensfeld 8/30
Ruby on Rails: An introduction – Theframework Lil bit boutRailsstructure The Framework Maciej Mensfeld 9/30
Ruby on Rails: An introduction – Theframework Lil bit boutRailsstructure Tryit out! cd ~ railsnewmy_blog … (output): create create README createRakefile createconfig.ru create .gitignore createGemfile createapp createapp/assets/images/rails.png … To much stuff! WTF?! Maciej Mensfeld 10/30
Ruby on Rails: An introduction – Theframework Lil bit boutRailsstructure Fortunatelyyoudon’tneed to careaboutthis :) Maciej Mensfeld 0
Ruby on Rails: An introduction – Theframework MVC Maciej Mensfeld 12/30
Ruby on Rails: An introduction – Theframework Rails MVC Maciej Mensfeld 13/30
Ruby on Rails: An introduction – Theframework Models ;) Maciej Mensfeld 14/30
Ruby on Rails: An introduction – Theframework ActiveRecordmodels Maciej Mensfeld 15/30
Ruby on Rails: An introduction – Theframework Modelsshould be… Fat! Fat! Fat!!!! Fat! Fat! Fat!!!! Fatmodels, thincontrollers Fat! Fat! Fat!!!! Fat! Fat! Fat!!!! Fat! Fat! Fat!!!! Maciej Mensfeld 16/30
Ruby on Rails: An introduction – Theframework But… don’tpissoff Vegeta ;) Make fatmodels and thincontrollersor Vegeta will visit U… Maciej Mensfeld 17/30
Ruby on Rails: An introduction – Theframework ActionController Maciej Mensfeld 18/30
Ruby on Rails: An introduction – Theframework ActionController – be Restful Maciej Mensfeld 19/30
Ruby on Rails: An introduction – Theframework ActionController – be Restful Maciej Mensfeld 20/30
Ruby on Rails: An introduction – Theframework ActionView Maciej Mensfeld 21/30
Ruby on Rails: An introduction – Theframework ActionViewtemplates ERB – templateswith HTM and Ruby code – used to display dinamicstufffromprepared by controllers Maciej Mensfeld 22/30
Ruby on Rails: An introduction – Exampleapp Enoughtheory, let’s start themagic! Maciej Mensfeld 23/30
Ruby on Rails: An introduction – Exampleapp GenerateRailsscaffold… Tryit out! Maciej Mensfeld 24/30
Ruby on Rails: An introduction – Exampleapp Start railsserver to checkifitworks Tryit out! Go to http://localhost:3000/ Maciej Mensfeld 25/30
Ruby on Rails: An introduction – Exampleapp Yay! Itworks! Maciej Mensfeld 26/30
Ruby on Rails: An introduction – Exampleapp CreatingPosts Tryit out! Maciej Mensfeld 27/30
Ruby on Rails: An introduction – Exampleapp CreatingPosts Tryit out! Yeahitworks but… we cancreateemptyposts :( not good :( Maciej Mensfeld 28/30
Ruby on Rails: An introduction – Exampleapp Protectcreate/update/destroy Tryit out! Ourblogworks but anyonecanadd, edit and removeposts… shitty :/ Maciej Mensfeld 29/30
Ruby: writingsomecoolstuff Live long and prosper! Presented by: Maciej Mensfeld maciej@mensfeld.pl dev.mensfeld.pl github.com/mensfeld Maciej Mensfeld 30/30