300 likes | 382 Views
Chapter 3.1 – RoR: An introduction. RoR: An introduction. Presented b y :. Maciej Mensfeld. senior ruby developer@wordwatch.com senior ruby developer@furioustribe.com. maciej@mensfeld.pl dev.mensfeld.pl github.com/mensfeld. Maciej Mensfeld. Ruby on Rails: An introduction - Rules.
E N D
Chapter 3.1 – RoR: An introduction RoR: An introduction Presented by: Maciej Mensfeld senior ruby developer@wordwatch.com senior ruby developer@furioustribe.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; • …ask questions, if anything i say is not clear; • …feel free to share your own observations Maciej Mensfeld
Ruby on Rails: An introduction – Rails what? RoR: An introduction Maciej Mensfeld
Ruby on Rails: An introduction – What is Ruby on Rails? RoR: What is 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
Ruby on Rails: An introduction – What is 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
Ruby on Rails: An introduction – What is 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 • Productivity boost! 3-4 timesfasterthandevwithzend Reallyfaster? Maciej Mensfeld
Ruby on Rails: An introduction – What is 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
Ruby on Rails: An introduction – Who uses RoR? I do! ;) (but not only…) and thousands of other… Maciej Mensfeld
Ruby on Rails: An introduction – The framework Lil bit bout Rails structure The Framework Maciej Mensfeld
Ruby on Rails: An introduction – The framework Lil bit bout Rails structure 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
Ruby on Rails: An introduction – The framework Lil bit bout Rails structure Fortunatelyyoudon’tneed to careaboutthis :) Maciej Mensfeld
Ruby on Rails: An introduction – The framework MVC Maciej Mensfeld
Ruby on Rails: An introduction – The framework Rails MVC Maciej Mensfeld
Ruby on Rails: An introduction – The framework Models ;) Maciej Mensfeld
Ruby on Rails: An introduction – The framework ActiveRecord models Maciej Mensfeld
Ruby on Rails: An introduction – The framework Models should be… Fat! Fat! Fat!!!! Fat! Fat! Fat!!!! Fat models, thin controllers Fat! Fat! Fat!!!! Fat! Fat! Fat!!!! Fat! Fat! Fat!!!! Maciej Mensfeld
Ruby on Rails: An introduction – The framework But… don’t piss off Vegeta ;) Make fat models and thin controllers or Vegeta will visit U… Maciej Mensfeld
Ruby on Rails: An introduction – The framework ActionController Maciej Mensfeld
Ruby on Rails: An introduction – The framework ActionController – be Restful Maciej Mensfeld
Ruby on Rails: An introduction – The framework ActionController – be Restful Maciej Mensfeld
Ruby on Rails: An introduction – The framework ActionView Maciej Mensfeld
Ruby on Rails: An introduction – The framework ActionView templates ERB – templateswith HTM and Ruby code – used to display dinamicstufffromprepared by controllers Maciej Mensfeld
Ruby on Rails: An introduction – Example app Enough theory, let’s start the magic! Maciej Mensfeld
Ruby on Rails: An introduction – Example app Generate Rails scaffold… Tryit out! Maciej Mensfeld
Ruby on Rails: An introduction – Example app Start rails server to check if it works Tryit out! Go to http://localhost:3000/ Maciej Mensfeld
Ruby on Rails: An introduction – Example app Yay! It works! Maciej Mensfeld
Ruby on Rails: An introduction – Example app Creating Posts Tryit out! Maciej Mensfeld
Ruby on Rails: An introduction – Example app Creating Posts Tryit out! Yeahitworks but… we cancreateemptyposts :( not good :( Maciej Mensfeld
Ruby on Rails: An introduction – Example app Protect create/update/destroy Tryit out! Ourblogworks but anyonecanadd, edit and removeposts… shitty :/ Maciej Mensfeld
Ruby: writing some cool stuff Live long and prosper! Presented by: Maciej Mensfeld maciej@mensfeld.pl dev.mensfeld.pl github.com/mensfeld Maciej Mensfeld