Hello, world! 3.1. Ruby on Rails Web SimpleGreeter Hello, world! Rails SimpleGreeter Web Rails projects. ruby $ mkdir -p ~/projects

Similar documents
Introduction and first application. Luigi De Russis. Rails 101

Lecture 4. Ruby on Rails 1 / 52

Lecture 4. Ruby on Rails 1 / 49

Day 8: 7/June/2012. Log-in Authentication

IMAGE LINKS - INTRODUCTION

Extracting Representative. Najlaa Gali, Andrei Tabarcea and Pasi Fränti

CSCI-2320 Web Programming: Ruby on Rails

Dynamic Product Options extension for Magento2. User Guide

Rails: Views and Controllers

Dynamic Product Options extension for Magento2. User Guide

Introduction to Ruby on Rails

Your departmental website

Introduction to Ruby on Rails

Namma Kalvi.

Introduction to Ruby on Rails

Learn Ruby on Rails. Learn Web Development With Ruby on Rails

HTML HTML5. DOM(Document Object Model) CSS CSS

Bitnami Ruby for Huawei Enterprise Cloud

Static Site Generation

Contents in Detail. Foreword by Xavier Noria

Web System Development with Ruby on Rails

HTML (Hypertext Mark-up language) Basic Coding

Getting Started with Rails

Table of Contents EVALUATION COPY

Lecture 7. Action View, Bootstrap & Deploying 1 / 40

COMP519: Web Programming Lecture 4: HTML (Part 3)

Lab 1: Introducing HTML5 and CSS3

LING 408/508: Computational Techniques for Linguists. Lecture 14

Standard Design Reference

레드마인 설치 작성일 : 작성자 : 김종열

COM401 Software Engineering Laboratory

Building a Rails Application

Web UI. Survey of Front End Technologies. Web Challenges and Constraints. Desktop and mobile devices. Highly variable runtime environment

Web Development & Design Foundations with XHTML. Chapter 4 Key Concepts

Rails 4 Quickly. Bala Paranj

Episode 298. Getting Started With Spree

How to set up a local root folder and site structure

Day 3: 26/April/2012 Scaffolding Generation of Skeletons; Test run Memopad

ChiliProject - Bug # 529: builder is not part of the bundle. Add it to Gemfile

for Beginners COPYRIGHT NATIONAL SEMINARS TRAINING. ALL RIGHTS RESERVED.

Rails 5 Quickly. Bala Paranj

Anatomy of an HTML document

Strategies for Rapid Web Prototyping. Ruby on Rails. Clemens H. Cap

UNIX and Operating System Topics

Chapter 1 Introduction to Dreamweaver CS3 1. About Dreamweaver CS3 Interface...4. Creating New Webpages...10

Simple Image Viewer for IBM Content Navigator

Ruby on Rails Installation

Perfect Student Midterm Exam March 20, 2007 Student ID: 9999 Exam: 7434 CS-081/Vickery Page 1 of 5

Exam : 9A Title : Adobe GoLive CS2 ACE Exam. Version : DEMO

Page Content. Inserting Text To add text to your document, you can type the text directly or use Cut or Copy and Paste or Paste Special.

Step 1: Now you will be directed to the cloned profile that you created. Click on the "UI setting"

Oracle Data Visualization SDK

MODULE 2 HTML 5 FUNDAMENTALS. HyperText. > Douglas Engelbart ( )

Photo Gallery. Photo Gallery. Photo Gallery Name. Photo Gallery Body Text. Images. Image Title. Page 1 of 5

Apple News Apple Advertising Platforms Specifications November 2017

OpenShift Cheat Sheet

8/19/2018. Web Development & Design Foundations with HTML5. Learning Objectives (1 of 2) Learning Objectives (2 of 2) Horizontal Rule Element

Colligo Briefcase 3.0

Manual Html Image Src Url Path Not Working

Payment Pages Customisation Version 2

Index. alt, 38, 57 class, 86, 88, 101, 107 href, 24, 51, 57 id, 86 88, 98 overview, 37. src, 37, 57. backend, WordPress, 146, 148

Create a cool image gallery using CSS visibility and positioning property

PASS4TEST. IT Certification Guaranteed, The Easy Way! We offer free update service for one year

Responsive Web Design (RWD)

Web Site Design and Development Lecture 13

Figure 1 Forms category in the Insert panel. You set up a form by inserting it and configuring options through the Properties panel.

Web Development & Design Foundations with HTML5

Introduction to. Name: Class: ~ 1 ~

INFS 2150 / 7150 Intro to Web Development / HTML Programming

CREATIVE & TECHNICAL SPECIFICATIONS

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer. Laravel

Positioning in CSS: There are 5 different ways we can set our position:

Web Development and HTML. Shan-Hung Wu CS, NTHU

EXPORTING ASSETS. Lesson overview

Monarch Services Website Quick Guide

Web System Development by Ruby on Rails. Day 3(4/Oct/2012) First Project Internationalization

CSS Box Model. Cascading Style Sheets

introduction to XHTML

Where to get Images.

BEST PRACTICES HTML5 SPECIFICATIONS. what's next in data-driven advertising. File Types. HTML5: HTML, JS, CSS, JPG, JPEG, GIF, PNG, and SVG

Cascade V8.4 Website Content Management for the Site Manager UMSL

ADOBE 9A Adobe FrameMaker 7.0 Product Proficiency. Download Full Version :

Web Development & Design Foundations with HTML5 & CSS3 Instructor Materials Chapter 4 Test Bank

Static Site Generation

Responsive Design. Responsive design is it important? But typical is not enough. Some typical screen sizes

Part 3: Images & form styling NOMZAMO S WEBSITE

SUPPLYING GRAPHICS. This guide outlines how to supply different materials for the digital versions of your publication.

Briefcase ios 3.5. Enterprise, Pro, and Lite Editions. User Guide ipad

Dreamweaver MX The Basics

1. The basic building block of an HTML document is called a(n) a. tag. b. element. c. attribute. d. container. Answer: b Page 5

Lava New Media s CMS. Documentation Page 1

How to use the Assets panel

Programming web design MICHAEL BERNSTEIN CS 247

News. Ad Specifications for iad. March 2016

The figure below shows the Dreamweaver Interface.

Dreamweaver: Portfolio Site

Creating and Publishing Faculty Webpages

Model-View-Controller (MVC)

Video Embedder. Plugin for Joomla! This manual documents version 9.x of the Joomla! extension.

Fonts, text, and colour on the web. Sourcing, resizing, and inserting web site images MGMT 230 LAB

Transcription:

3 Hello, world! Ruby on Rails Web SimpleGreeter Hello, world! 3.1 Rails SimpleGreeter Web Rails projects OIAX BOOKS Ruby on Rails 5.0 $ mkdir -p ~/projects ruby 2.3.1 15

3 Hello, world! $ cd ~/projects $ rbenv local 2.3.1 ruby $ ruby -v OS 1 OS X 2 Ubuntu ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15] ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux] $ rails -v OK Rails 5.0.0 5.0.0 Rails 5.0 $ gem install rails -v 5.0 3.2 Rails SimpleGreeter rails new Rails 16

3.2 Rails rails new Gem -B --skip-bundle $ rails new simple_greeter -B simple_greeter Rails create create create create create create remove README.md Rakefile config.ru vendor/assets/stylesheets vendor/assets/stylesheets/.keep config/initializers/cors.rb simple_greeter bundle $ cd simple_greeter $ bundle Fetching gem metadata from https://rubygems.org/ Fetching version metadata from https://rubygems.org/ Fetching dependency metadata from https://rubygems.org/ Resolving dependencies... Using rake 11.2.2 Using rails 5.0.0 Using sass-rails 5.0.6 Bundle complete! 15 Gemfile dependencies, 63 gems now installed. 17

3 Hello, world! Use `bundle show [gemname]` to see where a bundled gem is installed. IDE IDE Atom atom. 3.3 Rails route Rails route Ruby on Rails 5.0 root route routing config/routes.rb 18

3.3 LIST config/routes.rb 1 Rails.application.routes.draw do 2 # For details on the DSL available within this file, see http://guides >.rubyonrails.org/routing.html 3 end LIST config/routes.rb 1 Rails.application.routes.draw do 2 - # For details on the DSL available within this file, see http://guides >.rubyonrails.org/routing.html 2 + get 'hello' => 'hello#show' 3 end hello hello#show action controller app/controllers hello_controller.rb LIST app/controllers/hello_controller.rb (New) 1 class HelloController < ApplicationController 2 def show 3 end 4 end 1 Hello 2 show 19

3 Hello, world! 2 3 template HTML app/views hello $ mkdir -p app/views/hello app/views/hello show.html.erb LIST app/views/hello/show.html.erb (New) 1 <p>hello, world!</p> hello show Hello, world! Rails $ rails s => Booting Puma => Rails 5.0.0 application starting in development on http://localhost: > 3000 => Run `rails server -h` for more startup options Puma starting in single mode... * Version 3.6.0 (ruby 2.3.1-p112), codename: Sleepy Sunday Serenity 20

3.3 * Min threads: 5, max threads: 5 * Environment: development * Listening on tcp://localhost:3000 Use Ctrl-C to stop Listening on tcp://localhost:3000 Rails Rails Ctrl C 1 Puma Rails 4.2 WEBrick WEBrick Web ruby Web Puma Web Rails 5.0 Web Puma http://localhost:3000/hello Enter 3.1 http:// URL http:// 3.1 localhost:3000/hello 21

3 Hello, world! 3.1 Hello, world! <!DOCTYPE html> <html> <head> <title>simplegreeter</title> <meta name="csrf-param" content="authenticity_token" /> </head> <body> <p>hello, world!</p> </body> </html> 22

3.3 Rails HTML HTML HTML document HTML 5 23

15 Web Web 15.1 img HTML image img src URL alt alternative text HTML PNG JPEG GIF SVG 4 png jpeg gif svg JPEG jpg PNG 1,677 JPEG 1,677 GIF 256 119

15 SVG "Scalable Vector Graphics" NASA img <img src="https://www.oiax.jp/books/files/nasa_earth.jpg" alt=" "> img width height 100 <img src="https://www.oiax.jp/books/files/nasa_earth.jpg" alt=" " width="240" height="240"> 15.2 image_tag Rails img image_tag img app/assets/images $ wget https://www.oiax.jp/books/files/robot.svg $ mv robot.svg app/assets/images hello#show LIST app/views/hello/show.html.erb : 4 <div class="card m-a-1"> 5 + <%= image_tag 'robot.svg', alt: 'Robot', size: '320x320' %> 6 <div class="card-block card-inverse card-success"> : image_tag 1 robot.svg alt size 120

15.3 x SimpleGreeter Alice 15.1 15.1 15.3 iphone 5 15.2 121

15 15.2 iphone 5 320px Card show.html.erb LIST app/views/hello/show.html.erb : 5 - <%= image_tag 'robot.svg', alt: 'Robot', size: '320x320' %> 5 + <%= image_tag 'robot.svg', alt: 'Robot', 6 + style: 'width: 100%; max-width: 320px' %> : image_tag size style CSS width 100% iphone 5 122

15.3 15.2 max-width 320px : image_tag img HTML 15.1 src... <img alt="robot" width="320" height="320" src="/assets/robot-e31c3ae...f5fa5a1.svg" /> image_tag 1 robot.svg 64 16 app/assets/images URL /assets/ 64 16 SHA-256 fingerprint fingerprint 123

15 15.4 Web SimpleGreeter Web favicon Web Web Web $ wget https://www.oiax.jp/books/files/simple_greeter.ico $ wget https://www.oiax.jp/books/files/robot256.png $ mv simple_greeter.ico robot256.png app/assets/images ICO ico Web 256 JPEG PNG LIST app/views/layouts/application.html.erb : 9 <%= javascript_include_tag 'application', 'data-turbolinks-track': ' > reload' %> 10 + <%= favicon_link_tag('simple_greeter.ico') %> 11 + <%= favicon_link_tag('robot256.png', rel: 'apple-touch-icon') %> 12 </head> : favicon_link_tag HTML 124

15.4 Web <link rel="shortcut icon" type="image/x-icon" href="/assets/favicon- > 84047ae...141ea09.ico" /> <link rel="apple-touch-icon" type="image/x-icon" href="/assets/robot256- > eeebb62...35ea802.png" /> HTML link HTML head CSS Web link 15.3 15.3 Ruby on Rails 5.0 Ruby on Rails 5.0 2016 125