Introduction to Ruby&Rails Yuri Veremeyenko Monica Verma.

Slides:



Advertisements
Similar presentations
Applied Ruby on Rails & AJAX An insight into the technology and principles behind a social networking community.
Advertisements

PHP + Framework + MVC. What is Framework? Common code - Generic functionality Extensible - Specific functionality Unlike library – Flow Dictated by.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 15 Introduction to Rails.
Introduction to MVC Adding a View Page NTPCUG Tom Perkins, Ph.D.
Introduction to PHP MIS 3501, Fall 2014 Jeremy Shafer
Chapter 15 © 2010 by Addison Wesley Longman, Inc Origins and Uses of Ruby - Designed by Yukihiro Matsumoto; released in Use spread rapidly.
Trestle Generator Industrial-strength scaffolding for Ruby on Rails web application development.
Creating Web Services with Ruby on Rails Robert Thew Internet and Web Systems II.
Ruby on Rails Web development that doesn’t hurt By Mylore, Dung, Lee, Karen and Bryan.
1 JRuby on Rails GAO ANG Sun Functional Campus Ambassador 1.
Razor. Slide 2 Remember this? Browser Web Server HTTP Request HTTP Response (Web page / code) Client code (script) Interpret request Generate HTML and.
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.
CS 142 Lecture Notes: Rails ActiveRecordSlide 1 Model for Student Table SELECT * FROM students; | id | name.
Creating a wiki blog. Run apps that come with instant rails distribution select I /rails applications/open ruby console window Cd to cookbook or typo.
INTRO TO MAKING A WEBSITE Mark Zhang.  HTML  CSS  Javascript  PHP  MySQL  …That’s a lot of stuff!
Overview of Framework by Ahamed Rifaudeen A. page - i Steps before entering into the Framework?  Basic knowledge of object-oriented programming (OOP)
Web frameworks design comparison draft - please help me improve it.
Ruby on Rails: An Introduction JA-SIG Summer Conference 2007 Michael Irion The University of Tulsa.
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 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/
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,
Ruby on Rails CSCI 6314 David Gaspar Jennifer Garcia Avila.
ZFApp Preview Walkthrough. What is ZFApp? ZFApp is an application framework built on top of Zend Framework Fully compatible with the latest ZF Versions.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
Rails and Grails. To get started Make sure you have java installed You can get the sdk and jre at:
1 Dr Alexiei Dingli Web Science Stream Models, Views and Controllers.
Web Application Programming Carol Wolf Computer Science.
Ajax and Ruby on Rails Session 9 INFM 603.
PHP TUTORIAL. HISTORY OF PHP  PHP as it's known today is actually the successor to a product named PHP/FI.  Created in 1994 by Rasmus Lerdorf, the very.
1 An Introduction to the Development of Web Applications using Ruby on Rails with Ajax Ansgar Berhorn, B.Sc. and Mike Rowe, Ph.D.
1 Dr Alexiei Dingli Web Science Stream Advanced ROR.
Lecture 19 Web Application Frameworks Boriana Koleva Room: C54
1 Dr Alexiei Dingli Web Science Stream Introducing Rails.
Introduction to ASP.NET MVC Information for this presentation was taken from Pluralsight Building Applications with ASP.NET MVC 4.
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.
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.
© Copyright IBM Corporation 2007 AP/Americas April 15-18, 2007 Anaheim, California Introduction to RubyOnRails - a J2EE replacement? Russell Scheerer –
Arnold Geraldo Designing and Making of The Online Auction Website Using CakePHP Framework.
The Active Record Paradigm Databases in Database-Centric Web Site Development.
Associations INFO 2310: Topics in Web Design and Programming.
Chapter 15 © 2009 by Addison Wesley Longman, Inc Overview of Rails - Rails is a development framework for Web-based applications - Rails is written.
Photo Gallery INFO 2310: Topics in Web Design and Programming.
CS 142 Lecture Notes: Rails ActiveRecordSlide 1 Model for Student Table SELECT * FROM students; | id | name.
Ruby on Rails: Databases. Rails Database Familiar Table Concept Naming convention – lower case, plural (i.e. tweets) How to Access (find), Update, Delete.
Rails & Ajax Module 5. Introduction to Rails Overview of Rails Rails is Ruby based “A development framework for Web-based applications” Rails uses the.
Ruby/Ruby on Rails Yasushi Osonoi Open Dream corporation
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!
RUBY ON RAILS (RoR) Ishwor Khadka. Why Ruby on Rails?
Chapter 15 © 2013 by Pearson Overview of Rails - Rails is a development framework for Web-based applications - Based on MVC architecture for applications.
Introduction  “M” “V” “C” stands for “MODEL” “VIEW” “CONTROLLER”. ASP.NET MVC is an architecture to develop ASP.NET web applications in a different manner.
Introduction to information systems RUBY ON RAILS dr inż. Tomasz Pieciukiewicz.
Migrations Carol Wolf CS 396X. ISBNTitleAuthorImage EmmaAustenemma.jpg Oliver TwistDickenstwist.jpg HamletShakespearehamlet.jpg.
Text INTRODUCTION TO ASP.NET. InterComm Campaign Guidelines CONFIDENTIAL Simply Server side language Simplified page development model Modular, well-factored,
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.
1 Rails for the Ruby-Impaired John Paul Ashenfelter CTO/Transitionpoint.
Advanced Migration By Aye Mon Tun.  To change database schema in consistent and easy way  In ruby code Migration? 11/25/2013 2Web Application Engineering.
MVC Architecture, Symfony Framework for PHP Web Apps
ASP MVP Web applications and Razor
Play Framework: Introduction
Server Concepts Dr. Charles W. Kann.
MVC Framework, in general.
Ruby on Rails by Manik Juneja
Agile Web Development with Ruby and Rails
Ruby on Rails by Manik Juneja
Chapter 15 Introduction to Rails.
ASP.NET MVC Web Development
Presentation transcript:

Introduction to Ruby&Rails Yuri Veremeyenko Monica Verma

Presentation Structure 1.Ruby –Overview –Syntax 2.Rails –Introduction –What makes Rails a good choice? –Typical Web Request Flow –ROR and MVC 3.On-spot project creation –Basic application (blog)‏ –Scaffold, Migrations, Routing, etc. 4.Conclusions

Ruby - overview Originally from Japan, first public version 1995 Multipurpose: from scripting to fully fledged OO applications Current Version : Web Site: Ruby in your web browser:

Ruby – syntax examples Everything is an object 255.times {|i| puts "Hello #{i}" } Arrays a = [1, 'hi', 3.14, 1, 2] a.reverse a.each { |x| puts x } Hashes h = {:water => 'wet', :fire => 'hot'} h.each_pair do |key, value| puts "#{key} is #{value}"; end Ranges (0..2).each {|i| puts i} #=> [0, 1, 2]

Ruby – syntax examples II Classes & Methods class Person attr_accessor :name, :age def = name, age end p = Person.new("jay", 29)‏ p.name >> "jay” Exceptions raise ArgumentError, "Illegal arguments!”... begin # Do something rescue # Handle exception end

Ruby – syntax examples III Returning multiple parameters class MyClass < MyAbstractClass def my_method return 1, 2 end a = MyClass.new b, c = a.my_method Reflection a = MyClass.new a.public_methods a.respond_to? "mymethod"

Ruby on Rails “an open source web framework that optimizes for programmer happiness and sustainable productivity” This translates to: –Usage of MVC pattern –Scripts and generators for common actions –Use of Ruby's object nature –DRY (don't repeat yourself)‏ –Support for most Web 2.0 fancy stuff

ROR: installation Ruby –The ruby interpreter (1.8.6 recommended)‏ Gem –Gem is ruby package manager Database (postgres / mysql / sqlite)‏ –Install as you would normally Bind Ruby and your Database –Normally available as gem Rails and other Gems and libs, as required –Libopenssl-ruby, ruport, rdoc, irb, etc.. IDE

What are typical activities for web application? Display form Validate form Display form errors Save form Show aggregated data (and more forms)‏

What makes ROR a good choice? MVC ORM (ActiveRecord with associations)‏ Data validation standardized Well structured application layout Generators for common tasks Testing support

ROR in typical web request Fig.1 Web request flow

ROR and MVC Model : database logic, business data logic Controller : request processing, couples View and Model View : sets of templates to render HTML Fig.2 MVC in Rails

Generators and migrations Generators can create skeletons for models/views/controllers/ or scaffold >ruby script/generate scaffold MyEntity Migrations provide DB synchronization class CreatePosts < ActiveRecord::Migration def self.up create_table :posts do |t| { t.column :title, :string ; t.column :body, :text } end def self.down drop_table :posts ; end; end

Inside Rails Fig.3 Rails Model code

Example Application A sample blog application in 20 minutes Create Posts and Comments Scaffolding, migrations, rake Specifying relationships in Models Customizing generated Controllers Very basic HTML

Conclusions Ruby on Rails: Is an MVC framework for Web application Has efficient ActiveRecord ORM Supports migrations Has generators for common tasks Supports unit testing Provides AJAX support via prototype RESTful since v2.0