Enviar pesquisa
Carregar
Ruby Rails Overview
•
30 gostaram
•
9,049 visualizações
Netguru
Seguir
Ruby & Rails Overview, slides by Michal Poczwardowski, Ruby on Rails developer at @netguru
Leia menos
Leia mais
Software
Tecnologia
Denunciar
Compartilhar
Denunciar
Compartilhar
1 de 69
Baixar agora
Baixar para ler offline
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
Mais conteúdo relacionado
Destaque
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
Destaque
(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.
Semelhante 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
Semelhante 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
Mais 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
Mais 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
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
SelfMade bd
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
WSO2
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
HimanshiGarg82
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
masabamasaba
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
masabamasaba
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Bert Jan Schrijver
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
kalichargn70th171
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
Jittipong Loespradit
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
WSO2
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
masabamasaba
Define the academic and professional writing..pdf
Define the academic and professional writing..pdf
PearlKirahMaeRagusta1
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
masabamasaba
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
masabamasaba
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
masabamasaba
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
masabamasaba
Último
(20)
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
Define the academic and professional writing..pdf
Define the academic and professional writing..pdf
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
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!
Baixar agora