Enviar búsqueda
Cargar
Ruby Rails Overview
•
30 recomendaciones
•
9,049 vistas
Netguru
Seguir
Ruby & Rails Overview, slides by Michal Poczwardowski, Ruby on Rails developer at @netguru
Leer menos
Leer más
Software
Tecnología
Denunciar
Compartir
Denunciar
Compartir
1 de 69
Descargar ahora
Descargar para leer sin conexión
Recomendados
Ruby seen by a C# developer
Ruby seen by a C# developer
Emanuele DelBono
Chaithanya resume ruby on rails
Chaithanya resume ruby on rails
Chaithanya A
Muhammad Ahsan Javed - Visionet
Muhammad Ahsan Javed - Visionet
Muhammad Ahsan Ranjha
Introduction to Ruby on Rails
Introduction to Ruby on Rails
mithunsasidharan
Intro to java programming
Intro to java programming
Eugene Stephens
2015 bioinformatics python_introduction_wim_vancriekinge_vfinal
2015 bioinformatics python_introduction_wim_vancriekinge_vfinal
Prof. Wim Van Criekinge
Paradygmaty Programowania: Czy Istnieje Najlepszy?
Paradygmaty Programowania: Czy Istnieje Najlepszy?
Netguru
CSS architecture: How To Write Clean & Scalable Code
CSS architecture: How To Write Clean & Scalable Code
Netguru
Recomendados
Ruby seen by a C# developer
Ruby seen by a C# developer
Emanuele DelBono
Chaithanya resume ruby on rails
Chaithanya resume ruby on rails
Chaithanya A
Muhammad Ahsan Javed - Visionet
Muhammad Ahsan Javed - Visionet
Muhammad Ahsan Ranjha
Introduction to Ruby on Rails
Introduction to Ruby on Rails
mithunsasidharan
Intro to java programming
Intro to java programming
Eugene Stephens
2015 bioinformatics python_introduction_wim_vancriekinge_vfinal
2015 bioinformatics python_introduction_wim_vancriekinge_vfinal
Prof. Wim Van Criekinge
Paradygmaty Programowania: Czy Istnieje Najlepszy?
Paradygmaty Programowania: Czy Istnieje Najlepszy?
Netguru
CSS architecture: How To Write Clean & Scalable Code
CSS architecture: How To Write Clean & Scalable Code
Netguru
R Programming Overview
R Programming Overview
dlamb3244
Everyday Rails
Everyday Rails
Netguru
Why Would A Programmer Fall In Love With SPA?
Why Would A Programmer Fall In Love With SPA?
Netguru
Why no one is looking for rockstar programmers (updated version)
Why no one is looking for rockstar programmers (updated version)
Wiktor Schmidt
Hidden Gems in Swift
Hidden Gems in Swift
Netguru
Overview HTML, HTML5 and Validations
Overview HTML, HTML5 and Validations
Yaowaluck Promdee
Agile Retrospectives
Agile Retrospectives
Netguru
Czy Project Manger Musi Być Osobą Techniczną?
Czy Project Manger Musi Być Osobą Techniczną?
Netguru
KISS Augmented Reality
KISS Augmented Reality
Netguru
Z 50 do 100 w ciągu roku Jak rekrutować w IT?
Z 50 do 100 w ciągu roku Jak rekrutować w IT?
Netguru
Defining DSL (Domain Specific Language) using Ruby
Defining DSL (Domain Specific Language) using Ruby
Netguru
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Marakana Inc.
Communication With Clients Throughout The Project
Communication With Clients Throughout The Project
Netguru
Rozwijanie firmy web developerskiej - Kuba Filipowski, Wiktor Schmidt, Netguru
Rozwijanie firmy web developerskiej - Kuba Filipowski, Wiktor Schmidt, Netguru
Biznes 2.0
What is Python? An overview of Python for science.
What is Python? An overview of Python for science.
Nicholas Pringle
Rails Is From Mars Ruby Is From Venus Presentation 1
Rails Is From Mars Ruby Is From Venus Presentation 1
railsconf
TechDays - IronRuby
TechDays - IronRuby
Ben Hall
festival ICT 2013: Ruby, the 0.8 language you were looking for
festival ICT 2013: Ruby, the 0.8 language you were looking for
festival ICT 2016
An introduction to Ruby
An introduction to Ruby
Wes Oldenbeuving
Ruby Presentation - Handout
Ruby Presentation - Handout
Christopher Giroir
Gem That (2009)
Gem That (2009)
lazyatom
Why Ruby?
Why Ruby?
IT Weekend
Más contenido relacionado
Destacado
R Programming Overview
R Programming Overview
dlamb3244
Everyday Rails
Everyday Rails
Netguru
Why Would A Programmer Fall In Love With SPA?
Why Would A Programmer Fall In Love With SPA?
Netguru
Why no one is looking for rockstar programmers (updated version)
Why no one is looking for rockstar programmers (updated version)
Wiktor Schmidt
Hidden Gems in Swift
Hidden Gems in Swift
Netguru
Overview HTML, HTML5 and Validations
Overview HTML, HTML5 and Validations
Yaowaluck Promdee
Agile Retrospectives
Agile Retrospectives
Netguru
Czy Project Manger Musi Być Osobą Techniczną?
Czy Project Manger Musi Być Osobą Techniczną?
Netguru
KISS Augmented Reality
KISS Augmented Reality
Netguru
Z 50 do 100 w ciągu roku Jak rekrutować w IT?
Z 50 do 100 w ciągu roku Jak rekrutować w IT?
Netguru
Defining DSL (Domain Specific Language) using Ruby
Defining DSL (Domain Specific Language) using Ruby
Netguru
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Marakana Inc.
Communication With Clients Throughout The Project
Communication With Clients Throughout The Project
Netguru
Rozwijanie firmy web developerskiej - Kuba Filipowski, Wiktor Schmidt, Netguru
Rozwijanie firmy web developerskiej - Kuba Filipowski, Wiktor Schmidt, Netguru
Biznes 2.0
What is Python? An overview of Python for science.
What is Python? An overview of Python for science.
Nicholas Pringle
Destacado
(15)
R Programming Overview
R Programming Overview
Everyday Rails
Everyday Rails
Why Would A Programmer Fall In Love With SPA?
Why Would A Programmer Fall In Love With SPA?
Why no one is looking for rockstar programmers (updated version)
Why no one is looking for rockstar programmers (updated version)
Hidden Gems in Swift
Hidden Gems in Swift
Overview HTML, HTML5 and Validations
Overview HTML, HTML5 and Validations
Agile Retrospectives
Agile Retrospectives
Czy Project Manger Musi Być Osobą Techniczną?
Czy Project Manger Musi Być Osobą Techniczną?
KISS Augmented Reality
KISS Augmented Reality
Z 50 do 100 w ciągu roku Jak rekrutować w IT?
Z 50 do 100 w ciągu roku Jak rekrutować w IT?
Defining DSL (Domain Specific Language) using Ruby
Defining DSL (Domain Specific Language) using Ruby
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Communication With Clients Throughout The Project
Communication With Clients Throughout The Project
Rozwijanie firmy web developerskiej - Kuba Filipowski, Wiktor Schmidt, Netguru
Rozwijanie firmy web developerskiej - Kuba Filipowski, Wiktor Schmidt, Netguru
What is Python? An overview of Python for science.
What is Python? An overview of Python for science.
Similar a Ruby Rails Overview
Rails Is From Mars Ruby Is From Venus Presentation 1
Rails Is From Mars Ruby Is From Venus Presentation 1
railsconf
TechDays - IronRuby
TechDays - IronRuby
Ben Hall
festival ICT 2013: Ruby, the 0.8 language you were looking for
festival ICT 2013: Ruby, the 0.8 language you were looking for
festival ICT 2016
An introduction to Ruby
An introduction to Ruby
Wes Oldenbeuving
Ruby Presentation - Handout
Ruby Presentation - Handout
Christopher Giroir
Gem That (2009)
Gem That (2009)
lazyatom
Why Ruby?
Why Ruby?
IT Weekend
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Bozhidar Batsov
Rubinius - A Tool of the Future
Rubinius - A Tool of the Future
evanphx
What's new in Ruby 2.0
What's new in Ruby 2.0
Kartik Sahoo
Redis, Resque & Friends
Redis, Resque & Friends
Christopher Spring
Ruby seen from a C# developer
Ruby seen from a C# developer
Codemotion
Let's talk about elixir - 26th Athens Ruby Meetup
Let's talk about elixir - 26th Athens Ruby Meetup
Skroutz S.A.
Rails by example
Rails by example
Angelo van der Sijpt
Ruby.new @ VilniusRB
Ruby.new @ VilniusRB
Vidmantas Kabošis
Simplifying Code: Monster to Elegant in 5 Steps
Simplifying Code: Monster to Elegant in 5 Steps
tutec
Smalltalk on rubinius
Smalltalk on rubinius
Konstantin Haase
Ruby for .NET developers
Ruby for .NET developers
Max Titov
Test
Test
PaulMWatson
Get your ass to 1.9
Get your ass to 1.9
Nic Benders
Similar a Ruby Rails Overview
(20)
Rails Is From Mars Ruby Is From Venus Presentation 1
Rails Is From Mars Ruby Is From Venus Presentation 1
TechDays - IronRuby
TechDays - IronRuby
festival ICT 2013: Ruby, the 0.8 language you were looking for
festival ICT 2013: Ruby, the 0.8 language you were looking for
An introduction to Ruby
An introduction to Ruby
Ruby Presentation - Handout
Ruby Presentation - Handout
Gem That (2009)
Gem That (2009)
Why Ruby?
Why Ruby?
Ruby on Rails 3.1: Let's bring the fun back into web programing
Ruby on Rails 3.1: Let's bring the fun back into web programing
Rubinius - A Tool of the Future
Rubinius - A Tool of the Future
What's new in Ruby 2.0
What's new in Ruby 2.0
Redis, Resque & Friends
Redis, Resque & Friends
Ruby seen from a C# developer
Ruby seen from a C# developer
Let's talk about elixir - 26th Athens Ruby Meetup
Let's talk about elixir - 26th Athens Ruby Meetup
Rails by example
Rails by example
Ruby.new @ VilniusRB
Ruby.new @ VilniusRB
Simplifying Code: Monster to Elegant in 5 Steps
Simplifying Code: Monster to Elegant in 5 Steps
Smalltalk on rubinius
Smalltalk on rubinius
Ruby for .NET developers
Ruby for .NET developers
Test
Test
Get your ass to 1.9
Get your ass to 1.9
Más de Netguru
Payments integration: Stripe & Taxamo
Payments integration: Stripe & Taxamo
Netguru
How To Build Great Relationships With Your Clients
How To Build Great Relationships With Your Clients
Netguru
From Birds To Bugs: Testowanie Z Pasją
From Birds To Bugs: Testowanie Z Pasją
Netguru
Estimation myths debunked
Estimation myths debunked
Netguru
Programming Paradigms Which One Is The Best?
Programming Paradigms Which One Is The Best?
Netguru
Ruby On Rails Intro
Ruby On Rails Intro
Netguru
Perfect Project Read Me (in a few steps)
Perfect Project Read Me (in a few steps)
Netguru
The Git Basics
The Git Basics
Netguru
From nil to guru: intro to Ruby on Rails
From nil to guru: intro to Ruby on Rails
Netguru
Working With Teams Across The Borders
Working With Teams Across The Borders
Netguru
Front-End Dev Tools
Front-End Dev Tools
Netguru
OOScss Architecture For Rails Apps
OOScss Architecture For Rails Apps
Netguru
Coffeescript presentation DublinJS
Coffeescript presentation DublinJS
Netguru
Blogi w firmie
Blogi w firmie
Netguru
Developing a webdevelopment company
Developing a webdevelopment company
Netguru
Barcamps in Europe
Barcamps in Europe
Netguru
Wiktor Schmidt, RuPy 2008, Caching in Rails
Wiktor Schmidt, RuPy 2008, Caching in Rails
Netguru
Barcamp #5 - API
Barcamp #5 - API
Netguru
Barcamp #5 - Mikrocelebryci
Barcamp #5 - Mikrocelebryci
Netguru
Más de Netguru
(19)
Payments integration: Stripe & Taxamo
Payments integration: Stripe & Taxamo
How To Build Great Relationships With Your Clients
How To Build Great Relationships With Your Clients
From Birds To Bugs: Testowanie Z Pasją
From Birds To Bugs: Testowanie Z Pasją
Estimation myths debunked
Estimation myths debunked
Programming Paradigms Which One Is The Best?
Programming Paradigms Which One Is The Best?
Ruby On Rails Intro
Ruby On Rails Intro
Perfect Project Read Me (in a few steps)
Perfect Project Read Me (in a few steps)
The Git Basics
The Git Basics
From nil to guru: intro to Ruby on Rails
From nil to guru: intro to Ruby on Rails
Working With Teams Across The Borders
Working With Teams Across The Borders
Front-End Dev Tools
Front-End Dev Tools
OOScss Architecture For Rails Apps
OOScss Architecture For Rails Apps
Coffeescript presentation DublinJS
Coffeescript presentation DublinJS
Blogi w firmie
Blogi w firmie
Developing a webdevelopment company
Developing a webdevelopment company
Barcamps in Europe
Barcamps in Europe
Wiktor Schmidt, RuPy 2008, Caching in Rails
Wiktor Schmidt, RuPy 2008, Caching in Rails
Barcamp #5 - API
Barcamp #5 - API
Barcamp #5 - Mikrocelebryci
Barcamp #5 - Mikrocelebryci
Último
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
MyIntelliSource, Inc.
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
SolGuruz
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
Cionsystems
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Alberto González Trastoy
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
Fatema Valibhai
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
Andolasoft Inc
Software Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
Arshad QA
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
bodapatigopi8531
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
anilsa9823
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
kellynguyen01
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Christina Lin
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
kalichargn70th171
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
stazi3110
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
OPEN KNOWLEDGE GmbH
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
VICTOR MAESTRE RAMIREZ
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
BradBedford3
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽❤️🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽❤️🧑🏻 89...
gurkirankumar98700
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
OnePlan Solutions
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
Jhone kinadey
Último
(20)
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
Software Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽❤️🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽❤️🧑🏻 89...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
Ruby Rails Overview
1.
Ruby & Rails
Overview brought by Michal Poczwardowski and Gdansk 11/05/15
2.
Michal Poczwardowski Ruby on
Rails developer michal.poczwardowski@netguru.co
3.
Software house web&mobile
4.
Software house web&mobile
5.
Agenda Part 1 ruby Part 2 rails
6.
Part 1 ruby
7.
Ruby is a
dynamic, scripting, object- oriented language...
8.
‘Programming languages must
feel natural to programmers.’ Yukihiro "Matz" Matsumoto
9.
10.
hello = ‘Hello
world!’ puts hello Hello world
11.
Try ruby in
a browser! tryruby.org
12.
13.
www.bloc.io/ruby-warrior Control brave knight
using ruby
14.
15.
Why ruby is
so cool?
16.
#1: puts ‘Yes’
if ‘Work’.starts_with? ‘W’ #2: population = 12_000_000 #3: misterious_number.between?(10, 20) Like a natural language
17.
def really? true end Aesthetic
18.
1: numbers =
[] 2: for i in [1,2,3,4] 3: numbers << i ** 2 4: end 5: numbers # => [1,4,9,16] Elegant - NON ruby-way solution
19.
numbers = [1,2,3,4].map
{ |i| i ** 2 } numbers # => [1,4,9,16] Elegant - ruby-way solution
20.
Everything is an
object!
21.
42
22.
42.times { puts
‘Awesome’ } Fixnum object
23.
:001 > 1.class =>
Fixnum :002 > (2.2).class => Float :003 > [].class => Array :004 > "Politechnika Gdańska".class => String :005 > nil.class => NilClass :006 > {}.class => Hash Output from irb
24.
Classes, objects 01: class
School 02: attr_reader :name 03: 04: def initialize(name) 05: @name = name 06: end 07: 08: def hello 09: puts “Hello #{name}” 10: end 11: end school = School.new(‘PG’) school.hello # => ‘Hello PG’
25.
- high performance
/ lower level stuff - multi-threading - graphics / data analysis Avoid ruby in case of
26.
Ruby is great
at... Metaprogramming
27.
Example with send 01:
class Rubyist 02: def face(mood) 03: send(mood) 04: end 05: 06: private 07: 08: def happy 09: ‘:)’ 10: end 11: 12: def sad 13: ‘:(‘ 14: end 15: end dev = Rubyist.new dev.face(:happy) # => ‘:)’ dev.face(:sad) # => ‘:(’
28.
Handle missing methods 1:
class Rubyist 2: def happy; ‘:)’ end 3: def sad; ‘:(‘ end 4: 5: def method_missing(name) 6: ‘:?’ 7: end 8: end dev = Rubyist.new dev.happy # => ‘:)’ dev.sad # => ‘:(’ dev.excited # => ‘:?’ dev.worried # => ‘:?’
29.
Define own methods 01:
class Rubyist 02: FACES = { 03: happy: ‘:)’, 04: sad: ‘:(’, 05: excited: ‘;D’, 06: angry: ‘:[‘ 07: } 08: 09: FACES.each do |key, value| 10: define_method(key) { value } 11: end 12: end dev = Rubyist.new dev.happy # => ‘:)’ dev.sad # => ‘:(’ dev.angry # => ‘:[’ dev.excited # => ‘;D’
30.
Everything changes 1: class
String 2: def with_smile 3: self + ‘ :)’ 4: end 5: end ‘Sad string’.with_smile # => ‘Sad string :)’
31.
‘With great power
comes great responsibility.’ Unkle Ben
32.
Write tests!
33.
Example rspec describe Rubyist
do subject { described_class.new } describe ‘#happy’ do it ‘returns happy face’ expect(subject.happy).to eq ‘:)’ end end end
34.
library -> gem
35.
36.
rubygems.org/stats - 9/05/15
37.
Gemfile 01: source 'https://rubygems.org' 02: 03:
gem ‘rails’, ‘4.2.1’ 04: gem ‘nokogiri’ 05: gem 'stripe', git: 'https://github.com/stripe/stripe-ruby' 06: 07: group :test do 08: gem ‘rspec-rails’ 09: end
38.
Part 2 ruby on
rails
39.
Rails is a
web application development framework
40.
‘Powerful web applications
that formerly might have taken weeks or months to develop can be produced in a matter of days.’ Tim O’Reilly
41.
Websites powered by
Rails
42.
43.
44.
45.
isitrails.com
46.
Convention over Configuration
47.
Structure
48.
controllers models views routes.rb, database.yml Gemfile
49.
MVC
50.
controller model view browser DB routes web server
51.
Let’s prepare some
code
52.
$ rails generate
model Post title:string content:text invoke active_record create db/migrate/20150509232514_create_posts.rb create app/models/post.rb invoke rspec create spec/models/post_spec.rb invoke factory_girl create spec/factories/posts.rb Magic spells
53.
01: class CreatePosts
< ActiveRecord::Migration 02: def change 03: create_table :posts do |t| 04: t.string :title 05: t.text :content 06: 07: t.timestamps 08: end 09: end 10: end Migration
54.
MVC in action
55.
http://localhost:3000/
56.
127.0.0.1 - GET
/index.html HTTP/1.0" 200 2326
57.
get ‘/’, to:
‘welcome#index’
58.
class WelcomeController <
ApplicationController def index @posts = Post.all end end
59.
class Post <
ActiveRecord::Base end
60.
61.
class Post <
ActiveRecord::Base end
62.
class WelcomeController <
ApplicationController def index @posts = Post.all end end
63.
<ul> <% @posts.each do
|post| %> <li> <%= post.title %> </li> <% end %> </ul> ERB
64.
%ul - @posts do
|post| %li =post.title HAML
65.
<html> … <body> … <%= yield %> … </body> </html>
66.
http://localhost:3000/
67.
This is almost
the end...
68.
Don’t forget to
visit netguru.co and our box no. 20
69.
Thanks!
Descargar ahora