RUBY ON RAILS Mark Zhang. In this talk  Overview of Ruby on Rails  Core ideas  Show a tiny bit of example code  Touch on several general web development/

Slides:



Advertisements
Similar presentations
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 15 Introduction to Rails.
Advertisements

INTRODUCTION TO ASP.NET MVC AND EXAMPLE WALKTHROUGH RAJAT ARYA EFECS - OIM DAWG – 4/21/2009 ASP.NET MVC.
Ruby on Rails Model of MVC. Model-View-Controller Paradigm A way of organizing a software system Benefits: Isolation of business logic from the user interface.
Creating Web Services with Ruby on Rails Robert Thew Internet and Web Systems II.
Stat-JR: eBooks Richard Parker. Quick overview To recap… Stat-JR uses templates to perform specific functions on datasets, e.g.: – 1LevelMod fits 1-level.
Fabian Vilers Hands on ASP.NET MVC.
Ruby on Rails Tutorial Peter Mosca April, Ruby on Rails Tutorial Ruby History Invented 12 years ago in Japan by Yukihiro Matsumoto Spent first 5.
Ruby on Rails by Manik Juneja Ruby On Rails. Ruby on Rails by Manik Juneja Rails is a Web Application development framework. Based on the MVC pattern.
Ruby on Rails a popular web application framework, aimed to increase the speed and ease of web development Ruby on Rails, Tim Zappe.
Software Architecture Patterns (2). what is architecture? (recap) o an overall blueprint/model describing the structures and properties of a "system"
Session-01. Layers Struts 2 Framework The struts 2 framework is used to develop MVC-based web application. Struts 1.0 was released in June The.
Ruby on Rails CSE 190M, Spring 2009 Week 5. Installing Rails First, install Ruby with RubyGems Then, install the Rails gem gem install rails -version=2.3.2.
INTRO TO MAKING A WEBSITE Mark Zhang.  HTML  CSS  Javascript  PHP  MySQL  …That’s a lot of stuff!
DR. MOHAMMAD IQBAL THANKS TO ADITYA SENGUPTA Comparing Web Frameworks.
Ruby on Rails (Slides modified by ements-2ed.shtml)
8/17/2015CS346 PHP1 Module 1 Introduction to PHP.
Overview of Framework by Ahamed Rifaudeen A. page - i Steps before entering into the Framework?  Basic knowledge of object-oriented programming (OOP)
Struts 2.0 an Overview ( )
The Easiest Way to Write Web Applications Jordi Sastre IT Architect, PSC May 2012.
Chapter 3.1 – RoR: An introduction Maciej Mensfeld Presented by: Maciej Mensfeld RoR: An introduction dev.mensfeld.pl github.com/mensfeld.
A little engineering on Rails Robert W. Hasker. Goals Intro to the Rails framework ▫Basic concepts: MVC, Active Record ▫A bit of Ruby Using Rails to build.
RUBY ON RAILS It’s so rad. What we’ll cover  What is Ruby?  What is RoR?  Why RoR?  Developing with RoR  Deployment  Demo  Questions.
Ruby on Rails Charles Severance Textbook: Build Your own Ruby on Rails Application by Patrick Lenz (ISBN: )
Ruby on Rails. What is Ruby on Rails? Ruby on Rails is an open source full-stack web framework. It is an alternative to PHP/MySQL. It can render templates,
Fun with Ruby and Rails Chris Jeris 18 October 2011.
Ruby on Rails CSCI 6314 David Gaspar Jennifer Garcia Avila.
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
Rails and Grails. To get started Make sure you have java installed You can get the sdk and jre at:
Chapter 3.2 – RoR: easier, faster, better Maciej Mensfeld Presented by: Maciej Mensfeld RoR: easier, faster, better mensfeld.pl github.com/mensfeld.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
1 CHAPTER 1 OVERVIEW of JDEVELOPER. 2 Overview of JDeveloper Oracle’s JDeveloper 10g (JDeveloper) is an integrated development environment for Java programming.
Chapter 4.1 – Deeper into Rails Maciej Mensfeld Presented by: Maciej Mensfeld Deeper into Rails mensfeld.pl github.com/mensfeld senior.
L. Grewe LAMP, WAMP and... Motivaiton Basic Web Systems with Delivery of Static and Dynamic Web Pages html, css, media javascript (“dynamic” on client.
Framework Universal & Infinite Software Solution.
Lecture 19 Web Application Frameworks Boriana Koleva Room: C54
® IBM Software Group © 2007 IBM Corporation J2EE Web Component Introduction
1 Dr Alexiei Dingli Web Science Stream Introducing Rails.
Ruby on Rails Your first app. Rails files app/ Contains the controllers, models, views and assets for your application. You’ll focus on this folder for.
CakePHP is an open source web development framework. It follows Model-View- Controller and is developed using PHP. IT is the basic for user to create.
Lecture 11 Rails Topics SaaSSaaS Readings: SaaS book Ch February CSCE 740 Software Engineering.
Ruby on Rails CSE 190M, Spring 2009 Week 6. Overview How to use a database Demo creating a blog application on Rails Explain how the application works.
The Active Record Paradigm Databases in Database-Centric Web Site Development.
Ruby on Rails (Slides modified by ements-2ed.shtml)
WEP Presentation for non-IT Steps and roles in software development 2. Skills developed in 1 st year 3. What can do a student in 1 st internship.
Rails & Ajax Module 5. Introduction to Rails Overview of Rails Rails is Ruby based “A development framework for Web-based applications” Rails uses the.
Model View Controller MVC Web Software Architecture.
Ruby on Rails By S. Christopher Hellriegel. Overview 1. What is Ruby on Rails? 2. What is MVC? 3. Simple example 4. Wow, that was cool!
Trunica Inc. 500 East Kennedy Blvd #300 Tampa, FL Cross Platform Mobile Apps With Cordova and Visual Studio 2015 © Copyright 2015.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
MVC WITH CODEIGNITER Presented By Bhanu Priya.
Date : 3/04/2010 Web Technology Solutions Class: PHP Web Application Frameworks.
Acsmcdcprofiles_extract A tool to make it much simpler to access the latest 5-year period estimates from the American Community Survey John Blodgett May,
Model-View-Controller an introduction to MVC design pattern with Castle.MonoRail Presentation: v1.0 Prepared by: Chorn Sokun
Ruby on Rails. Web Framework for Ruby Designed to make it easier to develop, deploy, and maintain web applications Design with Model-View-Controller –almost.
Modern Development Technologies in SharePoint SHAREPOINT SATURDAY OMAHA APRIL, 2016.
1 Rails for the Ruby-Impaired John Paul Ashenfelter CTO/Transitionpoint.
Stuff to memorise… "A method tells an object to perform an action. A property allows us to read or change the settings of the object."
Web Technology Solutions
J2EE Platform Overview (Application Architecture)
Introduction to .NET Florin Olariu
MVC Architecture, Symfony Framework for PHP Web Apps
Ruby Tooling in NetBeans
Web Applications Security What are web Applications?
Ruby, Rails, GUIs, and More
CO6025 Advanced Programming
Bruce Scharlau, University of Aberdeen, 2017
Ruby on Rails by Manik Juneja
Ruby on Rails by Manik Juneja
ASP.NET MVC Web Development
Presentation transcript:

RUBY ON RAILS Mark Zhang

In this talk  Overview of Ruby on Rails  Core ideas  Show a tiny bit of example code  Touch on several general web development/ software development concepts

What is Ruby on Rails?  Ruby on Rails is an open source full-stack web framework.  It is an alternative to PHP/MySQL.  It can render templates, handle user authentication, has built-in database functionality, etc.

Ruby on Rails  A lot of people love Ruby on Rails because it allows you to make websites really fast.

Advantages  Convention over Configuration  One example: every model is automatically included in the controllers (no imports necessary)  Less code, but can be confusing to beginners.  A lot of “automagic” behavior

Advantages  Ruby generally focuses on having simple, powerful code.  Rails focuses on programmer productivity and happiness.  Rails is generally regarded as well designed and thought out.

Advantages  Active community, lots of resources  The pains of Rails are quickly getting better  Gems  Bootstrap-sass, jquery-rails – automatically imports those  Faker – tool to automatically generate fake data  Rspec, capybara – testing integrated with rails (TDD)  Guard – automatically watch files and run tests

Disadvantages  Things are changing quickly, compatibility issues (rvm and gemsets help to solve this)  High initial learning curve  Lots of black magic  Forced to do things “the Rails Way”

Ruby  It’s not called Ruby on Rails for nothing.  But you only need a subset of Ruby to start using Rails.  I think it’s fine to dive into Rails first and learn about Ruby a little later.

Summary of the Talk  The Rails Way  REST  Models  Views  Controllers  Rails Tools  Structure of Rails App Directory  How to do Static Pages

The Rails Way  DRY – “Don’t Repeat Yourself  Convention Over Configuration  REST is the best pattern for web applications

REST  “Representational State Transfer”  Using resource identifiers such as URLs to represent “resources”.

Resources  Example with a “user” resource  Get back to this when talking about controllers.

Model-View-Controller Paradigm  A way of organizing a software system  Benefits:  Isolation of business logic from the user interface  Ease of keeping code DRY  Making it clear where different types of code belong for easier maintenance

MVC

Models (with demo)  the information (data) of the application and the rules to manipulate that data. Business logic should be concentrated here.  Models are usually related to tables in a database.  Model’s attributes are “columns”.  But not always.  Models that are not related to database tables are transient.

Models  You can use the interactive “rails console” to play with your models (and even modify your database)  You can also access the methods in your controllers (next slide)  Examples of methods on models:  david = User.find_by_name('David')  users = User.where(name: 'David', occupation: 'Code Artist').order('created_at DESC')  user.update(name: 'Dave')

Controllers (with demo)  Glue between model and view

Controllers  By default, conform to REST  The expectation is that each controller corresponds to a resource and each controller action corresponds to a RESTful action.  To tweak, go to config/routes.rb

RESTful controller actions

Views (Demo)  the user interface of your application  all code in views should deal with presentation of data.  usually HTML with embedded Ruby  Rails will automatically render a view at the end of a controller action.  If action was “index”, Rails will render index.html.erb

Views (Demo)  Additional organization to view files  Layouts (application.html.erb)  Partials (_header.html.erb)

Rails tools  Rails comes with a ton of tools  Manage your databases  Generate boilerplate code  Generators  rails generate controller Users new  rails generate model User name:string string

Structure of the Rails App Directory

How to do Static Pages (demo)

Summary of the Talk  The Rails Way  REST  Models  Views  Controllers  Rails Tools  Structure of Rails App Directory  How to do Static Pages

Installing Rails  Rails installer on Windows  On Mac/Linux  Install ruby  Install RVM (ruby version manager)  Install rails  Process can be finicky  Auto-installer on scripts.mit.edu

Deploying Rails  You can run it on Heroku ("cloud application platform") or with Phusion Passenger (module for Apache).

The Rails Way  DRY – “Don’t Repeat Yourself  The choice of MVC helps this  Convention Over Configuration  REST is the best pattern for web applications

What is Ruby on Rails?  Ruby on Rails is an open source full-stack web framework.  It is an alternative to PHP/MySQL.  It can render templates, handle user authentication, has built-in database functionality, etc.

Sample Code 

Mark Zhang RUBY ON RAILS