SlideShare a Scribd company logo
The web and
 programming:
an introduction
  Simple, short and friendly
3 basic question

What are web apps and how do they work?


What is Ruby, how is it connected to Rails?


What is Rails and what can we use it for?
How does the web work?



• Let’s take a look at an example:
 - What happens when I type
   railsgirls.com into my web browser?
(109.74.202.152)

                1) The web browser looks up the IP address of
                           the web site using DNS
           I want to
        know more about                       Wait, I need to find
           Rails Girls                     the address of the web
                                             server with that info.




Avtor fotografije: Ed Yourdon
2) The broswers sends a “GET” request
                to the server

Hey, I need info                           Just a moment
about Rails Girls                                 ...




                    HTTP request GET
                    Host: railsgirls.com
                                      j
    your computer
j




                                           host server for
                                           railsgirls.com
3) The servers respons with a web page,
              written in HTML language


                                     Aha! Found it!




                          response in
                         HTML language
                                    j
Let me see what
       tvoj računalnik
j




this looks like...                       host server for
                                         railsgirls.com
4) The web browser makes sure the web site
           is displayed correctly

                                  Ta-da!
                             Isn’t this a nice
                                web site?
So, what are we
going to work on today?




           j

        A web app for
        collecting ideas
What will the app look like
    in our browser?
Hmm... what are
  web apps?

 And what are
 web pages?
simplesushi.com
                           I want sushi!




                                                        j
           j
                                                         web page
          Octocat                          sushi.html



Photo by: melanie_hughes
sushi.html
                                         is as it is!
                                 simplesushi.com
          But ... I don’t
           eat fish ...




                                     j
j
                                      static
                        sushi.html   web page
Octocat
What about           fancysushi.com
  here? Can I get a sushi
       without fish?




j

Octocat
web app
                                                    on the server
                    What about




                                                          j
                                         fancysushi.com
               here? Can I get a sushi
                    without fish?




            j                                  Sure, Octocat,
                                               our sushi chef
          Octocat
                                                can adjust!


Photo by: iwillbehomesoon
web app
                                             on the server




                                                   j
                                  fancysushi.com




j
                                            Here’s your
Octocat           j                     personalized sushi.
                         sushi.html      Would you like a
                                          different one?
          the result is another
               web page
web app
                                        on the server




                                              j
                             fancysushi.com




j

Octocat       j
                     sushi.html

      however it is now a
     dynamic web page,
      tailored to the user
web app
      In the real world ...             on the server




                                             j
                              facebook.com




  j

 Octocat
           j

   that’s why Facebook has
different content for each of us
If we want to
build web apps ...
If we want to
build web apps ...




                           j
        We need to be able to talk to
        the sushi chef on the server
Ruby is one of the programming
languages that we can use in web apps
                                                  If you want
                                              me to do something,
                                              you’ve got to speak
                                                    Ruby!




   Other popular languages: PHP, Python, Java, ASP.NET, Perl ...
How we can use Ruby
        to talk to a computer?
As a starting point:
1) We need to have Ruby installed (Installation Party!)




2) Use Terminal or Command Prompt (Windows)
Simple example
Let’s use irb = Interactive RuBy




      “Rails Girls”
irb examples
"Rails Girls"           # strings
2+2                     # integers
2*2                     # Ruby as a simple calculator
"Rails " * 2            # multiplying a string
"Rails " + "Girls"      # combining two string
"Rails" * "Girls"       # multiplying strings doesn’t work
"Rails Girls".length    # but string do have their own useful methods
"Rails Girls".reverse
ime = "Rails Girls"     # to simplify work, we can store objects into variables
ime.length              # same method as before used on a variable, same result
ime.reverse
ime.upcase
ime.downcase
ime + ime               # variables can also be combined, just like before
Simple example
Let’s save a program into a .rb file for easy access




    Sublime Text 2                 Terminal
simple.rb


puts “Rails Girls”
ime.rb
quiz.rb
Even the big, scary dragon
                       is made out of simple Lego blocks!




Photo by: themickeyd
Bonus tip: learn programming
            at home with:



       http://tryruby.org
http://www.codeschool.com



                            http://www.codecademy.com
What about Rails?



    Rails = Ruby on Rails = RoR
= a framework, which makes sure we can
  easily use Ruby to build web apps
    = fast rails for Ruby on the web
We’ll build today’s app
     with Rails ...
... the app will be made with different text
    files with Ruby, HTML and other code
Rails* apps have three basic
                           building blocks
                           MVC architecture = Model | View | Controller




                                     Controller = sushi chef
                                     accepts requests, makes all parts
                                             work as a whole

  Model = ingredients
     represents database data                                                  View = sushi
                                                                         the representation of the result,
* And a lot of other web apps in different languages                              seen by users
Photo by: Michael Kappel
Confused? No worries :)

           When programming:
           • Googling is a must;
           • copy-paste a valid method;
           • getting a working result
             is what really matters.

           P.S.: Practice makes perfect!
Let’s warm up before we make our own app:
     getting to know web technologies!


                      My Bentobox                             Application:              Designed by:




                       Storage                            Logic
                       Backend.                            Backend.
                       How the application stores data.    How the application works.




                                                          Style and structure
                                                          Frontend.
                                                          How the application looks.


                       Infrastructure
                       Backend.
                       How the application runs.

More Related Content

KEY
RingoJS: Server-Side Javascript When Only Java Will Do
PDF
Programming & The Web & Programming the Web
PDF
Rails Girls: Programming, Web Applications and Ruby on Rails
PDF
WEB I - 01 - Introduction to Web Development
PPTX
Web programming and development - Introduction
PDF
Ruby MVC from scratch with Rack
ODP
Web Server-Side Programming Techniques
PPTX
Culture et numérique : Mutations et Invariants
RingoJS: Server-Side Javascript When Only Java Will Do
Programming & The Web & Programming the Web
Rails Girls: Programming, Web Applications and Ruby on Rails
WEB I - 01 - Introduction to Web Development
Web programming and development - Introduction
Ruby MVC from scratch with Rack
Web Server-Side Programming Techniques
Culture et numérique : Mutations et Invariants

Viewers also liked (20)

ODP
La gouvernance du web
PPTX
Histoire et sociologie du numérique, chapitre 1
PPT
Eap et Internet 2.0
PPTX
Why we need to talk about women and technology?
PDF
Introduction of Programming language
PDF
Introduction to Web Programming
PPTX
Rails Girls: Not Only for Girls - RubyKaigi 2014
PPTX
What makes AWS invincible? from JAWS Days 2014
PPTX
Introduction to programming
PPT
Internet Presentation
PDF
Introduction to R Programming
PPT
Introduction to-programming
PDF
Model View Controller (MVC)
PDF
software engineering notes for cse/it fifth semester
PPT
Mvc architecture
PPTX
Introduction to Programming Languages
PPT
Programming languages
PPT
Lect 1. introduction to programming languages
PPT
Cours informatique internet - 7ème (2011-2012)
PPT
The Internet Presentation
La gouvernance du web
Histoire et sociologie du numérique, chapitre 1
Eap et Internet 2.0
Why we need to talk about women and technology?
Introduction of Programming language
Introduction to Web Programming
Rails Girls: Not Only for Girls - RubyKaigi 2014
What makes AWS invincible? from JAWS Days 2014
Introduction to programming
Internet Presentation
Introduction to R Programming
Introduction to-programming
Model View Controller (MVC)
software engineering notes for cse/it fifth semester
Mvc architecture
Introduction to Programming Languages
Programming languages
Lect 1. introduction to programming languages
Cours informatique internet - 7ème (2011-2012)
The Internet Presentation
Ad

Similar to The web and programming: an introduction - Simple, short and friendly (20)

PPTX
Workshop Intro: FrontEnd General Overview
PDF
Coffeescript unfancy javascript
PDF
Isomorphic web application
PDF
In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
PDF
Culerity - Headless full stack testing for JavaScript
KEY
Why you should build your own JS Frontend Framework
PDF
HealthyCodeMay2014
PPTX
Intro to Rails
PPT
Introducing Japanese Cool Web Services
KEY
Concurrency in ruby
PDF
Isomorphic javascript - Uppsala.js #8
KEY
End to-End CoffeeScript
KEY
Notes (2012-06-08)
ODP
EuRuKo JRuby Talk 2008
KEY
Ruby On Rails
PDF
Mobile Monday - March 7th, 2011
PPTX
BlackBerry 10 Browser
PDF
Javascript beginner-handbook
PDF
javascript-beginner-handbook.pdf
PDF
Building native apps with web components
Workshop Intro: FrontEnd General Overview
Coffeescript unfancy javascript
Isomorphic web application
In Pursuit of the Holy Grail: Building Isomorphic JavaScript Apps
Culerity - Headless full stack testing for JavaScript
Why you should build your own JS Frontend Framework
HealthyCodeMay2014
Intro to Rails
Introducing Japanese Cool Web Services
Concurrency in ruby
Isomorphic javascript - Uppsala.js #8
End to-End CoffeeScript
Notes (2012-06-08)
EuRuKo JRuby Talk 2008
Ruby On Rails
Mobile Monday - March 7th, 2011
BlackBerry 10 Browser
Javascript beginner-handbook
javascript-beginner-handbook.pdf
Building native apps with web components
Ad

More from Alja Isakovic (19)

PDF
Starting a business as engineers: algorithms aren't everything
PDF
Zakaj moraš med razvojem produkta razmišljati kot obsedeni bivši?
PDF
IoT Design Manifesto: smernice za bolj odgovoren razvoj IoT izdelkov in storitev
PDF
Kako slike mačk pridejo na tvoj računalnik? Kratek, enostaven in mačje obarva...
PDF
Quantified Self: The what, the why and the brave new future
PDF
def hire_more_women_in_tech(you):
PDF
Git your Jekyll on - WebCamp Ljubljana 2015
PDF
Uvod v internet in programiranje: Enostavno, kratko in prijazno
PDF
Zakaj v startup svetu nikoli ni vrste pred ženskim straniščem?
PDF
What about the other half of your customers?
KEY
Android for girls: a new frontier
PDF
Cultures in virtual worlds
PDF
Online Tutoring Across Different Platforms
PDF
Moodle predstavitev
PDF
Virtualni svet Second Life
PDF
Sloodle
PDF
Virtual Worlds Introduction: Second Life and Beyond
PDF
Moodle presentation
PDF
Sloodle Presentation
Starting a business as engineers: algorithms aren't everything
Zakaj moraš med razvojem produkta razmišljati kot obsedeni bivši?
IoT Design Manifesto: smernice za bolj odgovoren razvoj IoT izdelkov in storitev
Kako slike mačk pridejo na tvoj računalnik? Kratek, enostaven in mačje obarva...
Quantified Self: The what, the why and the brave new future
def hire_more_women_in_tech(you):
Git your Jekyll on - WebCamp Ljubljana 2015
Uvod v internet in programiranje: Enostavno, kratko in prijazno
Zakaj v startup svetu nikoli ni vrste pred ženskim straniščem?
What about the other half of your customers?
Android for girls: a new frontier
Cultures in virtual worlds
Online Tutoring Across Different Platforms
Moodle predstavitev
Virtualni svet Second Life
Sloodle
Virtual Worlds Introduction: Second Life and Beyond
Moodle presentation
Sloodle Presentation

Recently uploaded (20)

PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Modernizing your data center with Dell and AMD
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Approach and Philosophy of On baking technology
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Empathic Computing: Creating Shared Understanding
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Reach Out and Touch Someone: Haptics and Empathic Computing
Spectral efficient network and resource selection model in 5G networks
Modernizing your data center with Dell and AMD
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Review of recent advances in non-invasive hemoglobin estimation
Approach and Philosophy of On baking technology
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Empathic Computing: Creating Shared Understanding
Encapsulation_ Review paper, used for researhc scholars
NewMind AI Monthly Chronicles - July 2025
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx

The web and programming: an introduction - Simple, short and friendly

  • 1. The web and programming: an introduction Simple, short and friendly
  • 2. 3 basic question What are web apps and how do they work? What is Ruby, how is it connected to Rails? What is Rails and what can we use it for?
  • 3. How does the web work? • Let’s take a look at an example: - What happens when I type railsgirls.com into my web browser?
  • 4. (109.74.202.152) 1) The web browser looks up the IP address of the web site using DNS I want to know more about Wait, I need to find Rails Girls the address of the web server with that info. Avtor fotografije: Ed Yourdon
  • 5. 2) The broswers sends a “GET” request to the server Hey, I need info Just a moment about Rails Girls ... HTTP request GET Host: railsgirls.com j your computer j host server for railsgirls.com
  • 6. 3) The servers respons with a web page, written in HTML language Aha! Found it! response in HTML language j Let me see what tvoj računalnik j this looks like... host server for railsgirls.com
  • 7. 4) The web browser makes sure the web site is displayed correctly Ta-da! Isn’t this a nice web site?
  • 8. So, what are we going to work on today? j A web app for collecting ideas
  • 9. What will the app look like in our browser?
  • 10. Hmm... what are web apps? And what are web pages?
  • 11. simplesushi.com I want sushi! j j web page Octocat sushi.html Photo by: melanie_hughes
  • 12. sushi.html is as it is! simplesushi.com But ... I don’t eat fish ... j j static sushi.html web page Octocat
  • 13. What about fancysushi.com here? Can I get a sushi without fish? j Octocat
  • 14. web app on the server What about j fancysushi.com here? Can I get a sushi without fish? j Sure, Octocat, our sushi chef Octocat can adjust! Photo by: iwillbehomesoon
  • 15. web app on the server j fancysushi.com j Here’s your Octocat j personalized sushi. sushi.html Would you like a different one? the result is another web page
  • 16. web app on the server j fancysushi.com j Octocat j sushi.html however it is now a dynamic web page, tailored to the user
  • 17. web app In the real world ... on the server j facebook.com j Octocat j that’s why Facebook has different content for each of us
  • 18. If we want to build web apps ...
  • 19. If we want to build web apps ... j We need to be able to talk to the sushi chef on the server
  • 20. Ruby is one of the programming languages that we can use in web apps If you want me to do something, you’ve got to speak Ruby! Other popular languages: PHP, Python, Java, ASP.NET, Perl ...
  • 21. How we can use Ruby to talk to a computer? As a starting point: 1) We need to have Ruby installed (Installation Party!) 2) Use Terminal or Command Prompt (Windows)
  • 22. Simple example Let’s use irb = Interactive RuBy “Rails Girls”
  • 23. irb examples "Rails Girls" # strings 2+2 # integers 2*2 # Ruby as a simple calculator "Rails " * 2 # multiplying a string "Rails " + "Girls" # combining two string "Rails" * "Girls" # multiplying strings doesn’t work "Rails Girls".length # but string do have their own useful methods "Rails Girls".reverse ime = "Rails Girls" # to simplify work, we can store objects into variables ime.length # same method as before used on a variable, same result ime.reverse ime.upcase ime.downcase ime + ime # variables can also be combined, just like before
  • 24. Simple example Let’s save a program into a .rb file for easy access Sublime Text 2 Terminal
  • 28. Even the big, scary dragon is made out of simple Lego blocks! Photo by: themickeyd
  • 29. Bonus tip: learn programming at home with: http://tryruby.org http://www.codeschool.com http://www.codecademy.com
  • 30. What about Rails? Rails = Ruby on Rails = RoR = a framework, which makes sure we can easily use Ruby to build web apps = fast rails for Ruby on the web
  • 31. We’ll build today’s app with Rails ...
  • 32. ... the app will be made with different text files with Ruby, HTML and other code
  • 33. Rails* apps have three basic building blocks MVC architecture = Model | View | Controller Controller = sushi chef accepts requests, makes all parts work as a whole Model = ingredients represents database data View = sushi the representation of the result, * And a lot of other web apps in different languages seen by users Photo by: Michael Kappel
  • 34. Confused? No worries :) When programming: • Googling is a must; • copy-paste a valid method; • getting a working result is what really matters. P.S.: Practice makes perfect!
  • 35. Let’s warm up before we make our own app: getting to know web technologies! My Bentobox Application: Designed by: Storage Logic Backend. Backend. How the application stores data. How the application works. Style and structure Frontend. How the application looks. Infrastructure Backend. How the application runs.