SlideShare a Scribd company logo
Everyday Rails
brought by Blaze Hadzik and
Blaze Hadzik
Ruby on Rails developer
blazej.hadzik@netguru.co
netguru
Software house
web&mobile
Team
Poznan, Warsaw, Gdansk, Krakow
Australia, India, America, Brazil
#transparency
Workshops
2 days
teams with mentors
fun
recruitment
/ˈruː.bi/
‘Programming languages must feel
natural to programmers.’
Matz
Ruby is a dynamic, scripting, object-
oriented language...
:014 > 1.class
=> Fixnum
:015 > (2.2).class
=> Float
:016 > [].class
=> Array
:017 > "Politechnika Slaska".class
=> String
:018 > nil.class
=> NilClass
:019 > “abc” + “d”
=> “abcd”
variables
type local instance class global constant
example name @name @@name $name NAME
you don’t have to specify variable type
Variables
a = 12
a.class # => Integer
a = “polsl”
a.class # => String
a = [‘a’, ‘b’, ‘c’]
a.class # => Array
Arrays and Hashes
a = [ 'ant', 'bee', 'cat', 'dog', 'elk' ]
a[0] # => "ant"
a[3] # => "dog"
# this is the same:
a = %w{ ant bee cat dog elk }
a[0] # => "ant"
a[3] # => "dog"
Arrays and Hashes
my_hash = {
building: ‘school’,
fruit: ‘orange’
}
puts my_hash[:building] # => ‘school’
Symbols
LOW_PRIORITY = 0
HIGH_PRIORITY = 1
priority = HIGH_PRIORITY
vs
priority = :high
Symbols are simply constants that you don’t have to predeclare and that are guaranteed to be unique.
Control structures
if/else statements
case statements
while structure
Blocks
Idioms
Idioms
a, b = 1, 2
a += b
a # => 3
@a ||= 1 # @a = 1 if @a.nil?
Classes, objects
Classes, objects
class School
def initialize(name)
@name = name
end
end
school = School.new(‘polsl’)
p school # =>#<School:0x007fa301836160 @name="polsl">
Class Attributes
class School
def initialize(name)
@name = name
end
def name=(name)
@name = name
end
def name
@name
end
end
Class Attributes
attr_reader
attr_writer
attr_accessor
Access Control
private
protected
public
Rails
‘It is impossible not to notice Ruby on Rails.’
Martin Fowler
Ruby is language
Rails is framework
DRY
Service Objects
Decorators
Convention over
Configuration
REST
Structure
controllers
models
views
routes.rb, database.yml
Gemfile
MVC
controller
model view
browser
DB
routes
web server
http://localhost:3000/
127.0.0.1 - GET /index.html HTTP/1.0" 200 2326
get ‘/’, to: ‘welcome#index’
class WelcomeController < ApplicationController
def index
@posts = Post.all
end
end
class Post < ActiveRecord::Base
end
Everyday Rails
class Post < ActiveRecord::Base
end
class WelcomeController < ApplicationController
def index
@posts = Post.all
end
end
<ul>
<% @posts.each do |post| %>
<li>
<%= post.title %>
</li>
<% end %>
</ul>
<html>
…
<body>
…
<%= yield %>
…
</body>
</html
http://localhost:3000/http://localhost:3000/
Let’s code
Thanks

More Related Content

PPTX
Java script
PDF
Kabukiza.tech 1 LT - ScalikeJDBC-Async & Skinny Framework #kbkz_tech
PDF
Why Would A Programmer Fall In Love With SPA?
PDF
Hidden Gems in Swift
PDF
Paradygmaty Programowania: Czy Istnieje Najlepszy?
PDF
CSS architecture: How To Write Clean & Scalable Code
PDF
Why no one is looking for rockstar programmers (updated version)
PDF
Czy Project Manger Musi Być Osobą Techniczną?
Java script
Kabukiza.tech 1 LT - ScalikeJDBC-Async & Skinny Framework #kbkz_tech
Why Would A Programmer Fall In Love With SPA?
Hidden Gems in Swift
Paradygmaty Programowania: Czy Istnieje Najlepszy?
CSS architecture: How To Write Clean & Scalable Code
Why no one is looking for rockstar programmers (updated version)
Czy Project Manger Musi Być Osobą Techniczną?

Viewers also liked (11)

PDF
Agile Retrospectives
PDF
KISS Augmented Reality
PDF
Z 50 do 100 w ciągu roku Jak rekrutować w IT?
PDF
Defining DSL (Domain Specific Language) using Ruby
PDF
Communication With Clients Throughout The Project
PDF
Rozwijanie firmy web developerskiej - Kuba Filipowski, Wiktor Schmidt, Netguru
PDF
From Birds To Bugs: Testowanie Z Pasją
PPT
Blogi w firmie
PDF
Ruby Rails Overview
PDF
How To Build Great Relationships With Your Clients
PDF
Payments integration: Stripe & Taxamo
Agile Retrospectives
KISS Augmented Reality
Z 50 do 100 w ciągu roku Jak rekrutować w IT?
Defining DSL (Domain Specific Language) using Ruby
Communication With Clients Throughout The Project
Rozwijanie firmy web developerskiej - Kuba Filipowski, Wiktor Schmidt, Netguru
From Birds To Bugs: Testowanie Z Pasją
Blogi w firmie
Ruby Rails Overview
How To Build Great Relationships With Your Clients
Payments integration: Stripe & Taxamo
Ad

Similar to Everyday Rails (20)

PPT
Rapid Application Development using Ruby on Rails
PPT
WorkinOnTheRailsRoad
PPT
Workin ontherailsroad
PPTX
Code for Startup MVP (Ruby on Rails) Session 2
PPT
Ruby On Rails Tutorial
PDF
Story for a Ruby on Rails Single Engineer
PDF
Workin On The Rails Road
PDF
Intro to Ruby on Rails
PPT
Intro To Ror
PPTX
Intro to Ruby/Rails at TechLady Hackathon
PDF
americansyscorp b/o ascitconsultancyservices
PDF
Ruby on Rails for beginners
PPT
The ruby programming language
PPT
Intro To Ror
PPTX
Ruby from zero to hero
PPTX
Ruby basics
PPS
Ruby 1.9.3 Basic Introduction
PPTX
Why Ruby?
PPTX
Rubyconf Bangladesh 2017 - Lets start coding in Ruby
PPTX
Ruby Basics
Rapid Application Development using Ruby on Rails
WorkinOnTheRailsRoad
Workin ontherailsroad
Code for Startup MVP (Ruby on Rails) Session 2
Ruby On Rails Tutorial
Story for a Ruby on Rails Single Engineer
Workin On The Rails Road
Intro to Ruby on Rails
Intro To Ror
Intro to Ruby/Rails at TechLady Hackathon
americansyscorp b/o ascitconsultancyservices
Ruby on Rails for beginners
The ruby programming language
Intro To Ror
Ruby from zero to hero
Ruby basics
Ruby 1.9.3 Basic Introduction
Why Ruby?
Rubyconf Bangladesh 2017 - Lets start coding in Ruby
Ruby Basics
Ad

More from Netguru (15)

PDF
Estimation myths debunked
PDF
Programming Paradigms Which One Is The Best?
PDF
Ruby On Rails Intro
PDF
Perfect Project Read Me (in a few steps)
PDF
The Git Basics
PDF
From nil to guru: intro to Ruby on Rails
PDF
Working With Teams Across The Borders
PDF
Front-End Dev Tools
PDF
OOScss Architecture For Rails Apps
KEY
Coffeescript presentation DublinJS
PDF
Developing a webdevelopment company
PDF
Barcamps in Europe
PDF
Wiktor Schmidt, RuPy 2008, Caching in Rails
PDF
Barcamp #5 - API
PDF
Barcamp #5 - Mikrocelebryci
Estimation myths debunked
Programming Paradigms Which One Is The Best?
Ruby On Rails Intro
Perfect Project Read Me (in a few steps)
The Git Basics
From nil to guru: intro to Ruby on Rails
Working With Teams Across The Borders
Front-End Dev Tools
OOScss Architecture For Rails Apps
Coffeescript presentation DublinJS
Developing a webdevelopment company
Barcamps in Europe
Wiktor Schmidt, RuPy 2008, Caching in Rails
Barcamp #5 - API
Barcamp #5 - Mikrocelebryci

Recently uploaded (20)

PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
Big Data Technologies - Introduction.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPT
Teaching material agriculture food technology
PDF
Spectral efficient network and resource selection model in 5G networks
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Advanced methodologies resolving dimensionality complications for autism neur...
Network Security Unit 5.pdf for BCA BBA.
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Dropbox Q2 2025 Financial Results & Investor Presentation
Reach Out and Touch Someone: Haptics and Empathic Computing
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Big Data Technologies - Introduction.pptx
Understanding_Digital_Forensics_Presentation.pptx
Empathic Computing: Creating Shared Understanding
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Encapsulation_ Review paper, used for researhc scholars
MIND Revenue Release Quarter 2 2025 Press Release
Building Integrated photovoltaic BIPV_UPV.pdf
Chapter 3 Spatial Domain Image Processing.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Teaching material agriculture food technology
Spectral efficient network and resource selection model in 5G networks

Everyday Rails