Ruby on Rails. SITC Workshop Series American University of Nigeria FALL 2017

Similar documents
Ruby on Rails Welcome. Using the exercise files

Are you using Ruby on Rails?

Teaching Ruby on Rails Dr Bruce Scharlau Computing Science Department University of Aberdeen Aberdeen, AB24 3UE

DOWNLOAD : THE RUBY PROGRAMMING LANGUAGE

Why Rails and Design for an Applica5on

CHORDS: Cloud-Hosted Real-time Data

Agile Web Development with Rails 5

Web Application Expectations

Ruby on Rails TKK, Otto Hilska

Agile Web Development With Rails (4th Edition - Rails 3 & Ruby 1.9) By Sam Ruby

Chapter 11 Program Development and Programming Languages

MVC: the Model-View-Controller architectural pattern

A Programming Languages Course at Web Speed

Lecture 4. Ruby on Rails 1 / 49

Lecture 4. Ruby on Rails 1 / 52

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

Boldface numbers indicate illustrations, code listings, and tables.

Introduction to Ruby on Rails

Hellerstein/Olston. Homework 6: Database Application. beartunes. 11:59:59 PM on Wednesday, December 6 th

At the Forge. What Is Ruby? Getting Started with Ruby. Reuven M. Lerner. Abstract

Learn Ruby On Rails For Web Development Learn Rails The Fast And Easy Way

Web Frameworks MMIS 2 VU SS Denis Helic. March 10, KMI, TU Graz. Denis Helic (KMI, TU Graz) Web Frameworks March 10, / 18

Introduction to Ruby on Rails

Symfony is based on the classic web design pattern called the MVC pattern

RubyConf China. Why Ruby? Yukihiro "Matz" Matsumoto. Copyright (c) 2008 Yukihiro "Matz" Matsumoto, No rights reserved


Introduction to Ruby on Rails

Grails Framework. Modern Web Applications written in Groovy CERN EUROPEAN ORGANIZATION FOR NUCLEAR RESEARCH. Eloy Reguero Fuentes.

Web Technologies VU ( ) Vedran Sabol. Nov 13, ISDS, TU Graz. Vedran Sabol (ISDS, TU Graz) Web Technologies Nov 13, / 60

Agile Web Development with Rails 5

Get in Touch Module 1 - Core PHP XHTML

Software Engineering 2 (SWT2) Chapter 2: Introduction into Ruby on Rails

Agile Web Development with Rails 5.1

CS252 Advanced Programming Language Principles. Prof. Tom Austin San José State University Fall 2013

Rails: MVC in action

Review. Fundamentals of Website Development. Web Extensions Server side & Where is your JOB? The Department of Computer Science 11/30/2015

FILE - JAVA WEB SERVICE TUTORIAL

JRuby and Ioke. On Google AppEngine. Ola Bini

Project Horizon Technical Overview. Steven Forman Principal Technical Consultant

Ruby on Rails 3 March 14th, 2011 Ken Li Allison Pon Kyra Leimert Matt Delaney Edward Bassett

CSCI-2320 Web Programming: Ruby on Rails

Courslets, a golf improvement web service. Peter Battaglia

CIS 086 : Week 1. Web Development with PHP and MySQL

Tomasz Szumlak WFiIS AGH 23/10/2017, Kraków

JavaScript Context. INFO/CSE 100, Spring 2005 Fluency in Information Technology.

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

Contents in Detail. Foreword by Xavier Noria

Tutorial Point On Html5 Pdf

Building a RESTful Structure Resource Using Ruby on Rails

Ruby on Rails 3. Robert Crida Stuart Corbishley. Clue Technologies

We aren t getting enough orders on our Web site, storms the CEO.

ASP.NET MVC Training

Fiz: A Component Framework for Web Applications. John Ousterhout Stanford University

Thesis Paper GAIN KNOWLEDGE OF THE PROGRAMMING LANGUAGE - RUBYONRAILS

Application Design and Development: October 30

Modern Perl Ebooks Free

Extreme Java Productivity with Spring Roo and Spring 3.0

JAVASCRIPT JQUERY AJAX FILE UPLOAD STACK OVERFLOW

BUILD YOUR OWN RUBY ON RAILS WEB APPLICATIONS BY PATRICK LENZ DOWNLOAD EBOOK : BUILD YOUR OWN RUBY ON RAILS WEB APPLICATIONS BY PATRICK LENZ PDF

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

Rails Manual Memory Management Oracle 11g

Front End Programming

The Ruby Programming Language: Everything You Need To Know By Yukihiro Matsumoto, David Flanagan

Oracle Mix. A Case Study. Ola Bini JRuby Core Developer ThoughtWorks Studios.

Patterns Of Enterprise Application Architecture

Computer Science Seminar. Whats the next big thing? Ruby? Python? Neither?

Modern and Responsive Mobile-enabled Web Applications

DOI: /ijarcsse/V7I1/01103

welcome to BOILERCAMP HOW TO WEB DEV

CSC 443: Web Programming

Microsoft Access 2010 VBA Programming Inside Out Free Ebooks PDF

Simple AngularJS thanks to Best Practices

Project Horizon Technical Overview. Bob Rullo GM; Presentation Architecture

The Role of Standards and Open Source Software in Student Information Systems

P a g e 1. Danish Tecnological Institute. Developer Collection Online Course k Developer Collection

Django with Python Course Catalog

Web Presentation Patterns (controller) SWEN-343 From Fowler, Patterns of Enterprise Application Architecture

CS240: Programming in C

Objective: To learn meaning and concepts of programming. Outcome: By the end of this students should be able to describe the meaning of programming

ApacheCon NA How to Avoid Common Mistakes in OFBiz Development Presented by Adrian Crum

Read & Download (PDF Kindle) Ruby: Programming, Master's Handbook: A TRUE Beginner's Guide! Problem Solving, Code, Data Science, Data Structures &

Developing Cross-Platform Native Apps with AppStudio for ArcGIS. Jo Fraley Erwin Soekianto

(p t y) lt d. 1995/04149/07. Course List 2018

Extend EBS Using Applications Express

CSc 372 Comparative Programming Languages

Model-View-Controller (MVC)

CSc 372. Comparative Programming Languages. 1 : Introduction. Department of Computer Science University of Arizona

React & Redux in Hulu. (Morgan Cheng)

Website Designing Training

iflame INSTITUTE OF TECHNOLOGY

CSE 498 CSE Courses and Skills Inventory Fall Name:

Automating ArcGIS Deployments Using Chef

Python Programming: An Introduction to Computer Science

SUSE Linux Enterprise Server 12 Modules

Contents. Contents... XI

Scripting without Scripts: A User-Friendly Integration of R, Python, Matlab and Groovy into KNIME

Groovy & Grails Scripting for Modern Web Applications. Rohit Nayak Talentica Software

Day 2: 19/April/2012 Installing Aptana IDE; Integrated Development Environment And Rails

Quick Web Development using JDeveloper 10g

Installation Download and installation instructions can be found at

Transcription:

Ruby on Rails SITC Workshop Series American University of Nigeria FALL 2017 1

Evolution of Web Web 1.x Web 1.0: user interaction == server roundtrip Other than filling out form fields Every user interaction causes server roundtrip Every roundtrip causes full page redraw Web 1.5: user interactions without contacting server e.g. form validation before submit e.g. selecting something from menu A causes contents of menu B to change But every roundtrip still causes full page redraw 2

Evolution of Web Web 2.x Separation of server roundtrip from page rendering Initial load of page & draw page User interaction causes background roundtrip to server Response from server captured and passed to a programmer-defined JavaScript function That function can redraw part of the page in place (using same mechanisms as Web 1.5) Result: desktop-like responsive UI s that can contact server Auto completion Lazy fetch of complicated parts of page etc 3

What is Ruby on Rails (RoR)? Ruby on Rails is an open-source, full-stack framework for developing databasebacked web applications according to the Model-View-Control pattern. Ruby on Rails is a gem (plug-in) to Ruby language. Created by David Heinemeier Hansson in 2004 4

What is Ruby on Rails (RoR)? The amazing productivity claims of Rails is the current buzz in the web development community. If your task is to create or manage web applications that capture and manipulate relational database from a web-based user interface, then Ruby on Rails may be the solution you ve been looking for to make your web development life easier. 5

Who is using Rails? Development framework for web applications written in Ruby Used by some of your favorite sites! 6

Who else is using Rails? Penny Arcade AListApart Gusto Shopify Strongspace Yakima-Herald Telegram Subtopic 7

Overview of Ruby on Rails Ruby is the programming language used to manipulate the framework Rails is the framework that provides the necessary infrastructure Rails is written in Ruby 8

When to use Rails New web-to-database systems Migrations from existing PHP, ASP, or Perl systems An alternative to non-enterprise J2EE systems Systems in that gap between simple scripts and complex enterprise systems 9

When NOT to use Rails Simple scripts Non-web projects Complex systems with legacy databases Possible to do but you will lose productivity gains 10

Ruby Features Ruby is a pure object-oriented programming language with a super clean syntax that makes programming elegant and fun. In Ruby, everything is an object Ruby is an interpreted scripting language, just like Perl, Python and PHP. 11

Ruby Features Ruby successfully combines Smalltalk's conceptual elegance, Python's ease of use and learning and Perl's pragmatism. Ruby originated in Japan in 1993 by Yukihiro matz Matsumoto, and has started to become popular worldwide in the past few years as more English language books and documentation have become available. 12

Rails Philosophy Convention over configuration (no XML) Don t Repeat Yourself (DRY) Rails is opinionated 13

Rails Strengths It s all about Scaffolding Productivity You often create temporary code in the early stages of development to help get an application up quickly and see how major components work together. Rails automatically creates much of the scaffolding you'll need. 14

Rails Strengths Write code, not configuration Convention over configuration Most Web development frameworks for.net or Java force you to write pages of configuration code. If you follow suggested naming conventions, Rails doesn't need much configuration. Naming your data model class with the same name as the corresponding database table id as the primary key name 15

Rails Strengths Write code, not configuration Rails introduces the Active Record framework, which saves objects to the database. Based on a design pattern cataloged by Martin Fowler, the Rails version of Active Record discovers the columns in a database schema and automatically attaches them to your domain objects using metaprogramming. This approach to wrapping database tables is simple, elegant, and powerful. 16

Rails Strengths Full Stack Web Framework Rails implements the model-view-controller (MVC) architecture. The MVC design pattern separates the component parts of an application 17

Rails Strengths Full Stack Web Framework 18

Rails Strengths Full Stack Web Framework 19

Rails Architecture Rails applications are implemented using the Model-View-Controller (MVC) Model ActiveRecord View ActionView Controller ActionController MVC pattern allows rapid change and evolution of the user interface and controller separate from the data model 20

Models Provide access to database tables Contain business rules Record CRUD (Create, Read, Update, Delete) An instance represents a row in a table Grade model instance => one row from grades table Models also define validations and associations with other models (see next slide). 21

Models 22

Controllers Handle user requests Retrieve data from models Invoke methods on models Send views and responses to users Should contain no business logic Only flow control 23

Rails-specific MVC components Helpers Partials Layouts 24

Helpers Place to put presentation logic Available to Views and controllers Rails has hundreds of built-in helpers for your views Easy to make your own 25

Partials Pieces of view code that can be reused Can be applied to a collection of data! Designed to be shared across multiple views Examples Form fields for Create and Update pages Search results Tables Table rows 26

Layouts Your templates are here. Global or controller-specific No need for header and footer separation Rails reads the template last and places your application within the content region Easy for designers to create layouts without knowing Rails 27

Migrations Database-independent schema definition Incrementally define your database Makes creation and recreation easy! I m platformindependent! 28

Scaffolding Generation of controllers and views based on model definition Not meant for production use! Needs tweaking first 29

Demo We will create simple CRUD-like application. Help me to choose one: Bookmarks (title, url) Article (title, body) helloworld (saying hello to the world) Student (lastname,firstname,id,degree_expected) 30

Deployment Linux is the best for deployment Windows is supported Shared Hosting providers supporting Rails Dreamhost (Great for personal stuff) BlueHost RailsPlayground High-availability providers RailsMachine EngineYard Heroku 31

Summary Rail s two guiding principles: Less software (Don t Repeat Yourself - DRY) Convention over Configuration (Write code not configuration files) 32

Resources - Books Learn to Program (Chris Pine) Agile Web Development with Rails (Dave Thomas and David Heinemeier Hansson) Ruby for Rails, Ruby techniques for Rails developers (David Black) Programming Ruby (Dave Thomas) Rails Recipes (Chad Fowler) 33

Resources Web Sites www.rubyonrails.org wiki.rubyonrails.com api.rubyonrails.org www.uwec.edu/webdev/ror for additional resources 34