Soumettre la recherche
Mettre en ligne
Ruby Rails Overview
•
30 j'aime
•
9,049 vues
Netguru
Suivre
Ruby & Rails Overview, slides by Michal Poczwardowski, Ruby on Rails developer at @netguru
Lire moins
Lire la suite
Logiciels
Technologie
Signaler
Partager
Signaler
Partager
1 sur 69
Télécharger maintenant
Télécharger pour lire hors ligne
Recommandé
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
Recommandé
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
Contenu connexe
En vedette
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
En vedette
(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.
Similaire à 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
Similaire à 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
Plus 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
Plus 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
Dernier
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
Wave PLM
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
Fatema Valibhai
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
ICS
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
aagamshah0812
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
MyIntelliSource, Inc.
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
Jhone kinadey
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
anilsa9823
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
OnePlan Solutions
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Steffen Staab
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
anilsa9823
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
bodapatigopi8531
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
SolGuruz
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
harshavardhanraghave
Software Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
Arshad QA
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
ABDERRAOUF MEHENNI
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
ThousandEyes
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
MyIntelliSource, Inc.
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
kalichargn70th171
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
panagenda
Dernier
(20)
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Software Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
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!
Télécharger maintenant