Download presentation
Presentation is loading. Please wait.
Published byJuliet Melanie Riley Modified over 9 years ago
1
Chapter 3.1 – RoR: An introduction Maciej Mensfeld Presented by: Maciej Mensfeld RoR: An introduction maciej@mensfeld.pl dev.mensfeld.pl github.com/mensfeld senior ruby developer@wordwatch.com senior ruby developer@furioustribe.com
2
Ruby on Rails: An introduction - Rules Maciej Mensfeld 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 RoR: An introduction
3
Ruby on Rails: An introduction – Rails what? Maciej Mensfeld RoR: An introduction
4
Ruby on Rails: An introduction – What is Ruby on Rails? Maciej Mensfeld 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 the job done – fast!
5
Ruby on Rails: An introduction – What is Ruby on Rails? Maciej Mensfeld RoR: Why Ruby on Rails? Lot of frameworks exists on the market and a lot of programming languages for the web but… Rails leads
6
Ruby on Rails: An introduction – What is Ruby on Rails? Maciej Mensfeld RoR: Why Ruby on Rails? Rails give the developers a real productivity boost for developing web applications Because of Ruby and domain specific languages Convention over Configuration Productivity boost! Really faster? 3-4 times faster than dev with zend
7
Ruby on Rails: An introduction – What is Ruby on Rails? Maciej Mensfeld 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
8
Ruby on Rails: An introduction – Who uses RoR? Maciej Mensfeld I do! ;) (but not only…) and thousands of other…
9
Ruby on Rails: An introduction – The framework Maciej Mensfeld Lil bit bout Rails structure The Framework
10
Ruby on Rails: An introduction – The framework Maciej Mensfeld Lil bit bout Rails structure Try it out! cd ~ rails new my_blog … (output): create create README create Rakefile create config.ru create.gitignore create Gemfile create app create app/assets/images/rails.png … To much stuff! WTF?!
11
Ruby on Rails: An introduction – The framework Maciej Mensfeld Lil bit bout Rails structure Fortunately you don’t need to care about this :)
12
Ruby on Rails: An introduction – The framework Maciej Mensfeld MVC
13
Ruby on Rails: An introduction – The framework Maciej Mensfeld Rails MVC
14
Ruby on Rails: An introduction – The framework Maciej Mensfeld Models ;)
15
Ruby on Rails: An introduction – The framework Maciej Mensfeld ActiveRecord models
16
Ruby on Rails: An introduction – The framework Maciej Mensfeld Models should be… Fat! Fat! Fat!!!! Fat models, thin controllers
17
Ruby on Rails: An introduction – The framework Maciej Mensfeld But… don’t piss off Vegeta ;) Make fat models and thin controllers or Vegeta will visit U…
18
Ruby on Rails: An introduction – The framework Maciej Mensfeld ActionController
19
Ruby on Rails: An introduction – The framework Maciej Mensfeld ActionController – be Restful
20
Ruby on Rails: An introduction – The framework Maciej Mensfeld ActionController – be Restful
21
Ruby on Rails: An introduction – The framework Maciej Mensfeld ActionView
22
Ruby on Rails: An introduction – The framework Maciej Mensfeld ActionView templates ERB – templates with HTM and Ruby code – used to display dinamic stuff from prepared by controllers
23
Ruby on Rails: An introduction – Example app Maciej Mensfeld Enough theory, let’s start the magic!
24
Ruby on Rails: An introduction – Example app Maciej Mensfeld Generate Rails scaffold… Try it out!
25
Ruby on Rails: An introduction – Example app Maciej Mensfeld Start rails server to check if it works Try it out! Go to http://localhost:3000/
26
Ruby on Rails: An introduction – Example app Maciej Mensfeld Yay! It works!
27
Ruby on Rails: An introduction – Example app Maciej Mensfeld Creating Posts Try it out!
28
Ruby on Rails: An introduction – Example app Maciej Mensfeld Creating Posts Try it out! Yeah it works but… we can create empty posts :( not good :(
29
Ruby on Rails: An introduction – Example app Maciej Mensfeld Protect create/update/destroy Try it out! Our blog works but anyone can add, edit and remove posts… shitty :/
30
Ruby: writing some cool stuff Maciej Mensfeld Live long and prosper! Presented by: Maciej Mensfeld maciej@mensfeld.pl dev.mensfeld.pl github.com/mensfeld
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.