Ruby on Rails Web development that doesn’t hurt. Ruby on Rails Framework written in the Ruby programming language for database- backed web applications.

Slides:



Advertisements
Similar presentations
Ruby (on Rails) CSE 190M, Spring 2009 Week 3. Web Programming in Ruby Ruby can be used to write dynamic web pages Similar to PHP, chunks of Ruby begins.
Advertisements

Chapter 15 © 2010 by Addison Wesley Longman, Inc Origins and Uses of Ruby - Designed by Yukihiro Matsumoto; released in Use spread rapidly.
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.
Web Applications Development Using Coldbox Platform Eddie Johnston.
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.
Introduction to Model-View-Controller (MVC) Web Programming with TurboGears Leif Oppermann,
Software Freedom Day th September 2007 Asia Pacific Institute of Information Technology Colombo, Sri Lanka. Nazly Ahmed Scripting The Web.
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
BY: ALBERTO CABEZAS 4/19/2010. INTRODUCTION: PHP is considered today as one of the most famous scripting languages. PHP is widely used as a general purpose.
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.
Server-Side vs. Client-Side Scripting Languages
PHP CSCE 330 February 6, 2003 Group Members: Antwan B. Phan George Hwang Luat Vu Programming Language Presentation.
Kashif Jalal CA-240 (072) Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 2 of…
Ruby on Rails a popular web application framework, aimed to increase the speed and ease of web development Ruby on Rails, Tim Zappe.
1 CS6320 – Why Servlets? L. Grewe 2 What is a Servlet? Servlets are Java programs that can be run dynamically from a Web Server Servlets are Java programs.
Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course materials.
DR. MOHAMMAD IQBAL THANKS TO ADITYA SENGUPTA Comparing Web Frameworks.
UNIT-V The MVC architecture and Struts Framework.
| Lugano, Ruby on Rails.
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: )
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
CIS 375—Web App Dev II ASP.NET 2 Introducing Web Forms.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Ruby & rails by Nicholas Belotti. What is ruby Ruby is an object orientated scripting language. In Ruby...everything is an object! Ruby was released in.
About Dynamic Sites (Front End / Back End Implementations) by Janssen & Associates Affordable Website Solutions for Individuals and Small Businesses.
INTERNET APPLICATION DEVELOPMENT For More visit:
Web Application Programming Carol Wolf Computer Science.
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.
COLD FUSION Deepak Sethi. What is it…. Cold fusion is a complete web application server mainly used for developing e-business applications. It allows.
Lecture 19 Web Application Frameworks Boriana Koleva Room: C54
1 Dr Alexiei Dingli Web Science Stream Introducing Rails.
Ruby! Ronald L. Ramos. What is Ruby? Ruby is a scripting language designed by Yukihiro Matsumoto, also known as Matz. It runs on a variety of platforms,
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.
Cross Site Integration “mashups” cross site scripting.
Putting it all together Dynamic Data Base Access Norman White Stern School of Business.
Arnold Geraldo Designing and Making of The Online Auction Website Using CakePHP Framework.
The Active Record Paradigm Databases in Database-Centric Web Site Development.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Active Server Pages (ASP), also known as Classic ASP or ASP Classic, was Microsoft's first server-side script engine for dynamically generated web pages.
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
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
Katari Globant 2008 (update to 2010). Katari  Katari is a framework to use as a starting point to develop new web applications.  Incorporates architecture,
MVC WITH CODEIGNITER Presented By Bhanu Priya.
Date : 3/04/2010 Web Technology Solutions Class: PHP Web Application Frameworks.
1 Getting Started with Ruby. 2 What’s Ruby? Ruby is an OO, dynamic, agile language –Everything’s an object For example, try puts -1.abs –Derives strengths.
Fundamentals of Web DevelopmentRandy Connolly and Ricardo HoarFundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Fundamentals of Web DevelopmentRandy.
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.
Presented by Alexey Vedishchev Developing Web-applications with Grails framework American University of Nigeria, 2016 Intro To MVC Architecture.
Presented By P.SRIVIDYA 085D1A0552 Programming Language.
JRuby on Rails Presenter Name
Cake PHP – OOPS approach for PHP
JRuby on Rails Brian Leonard ブライアン レオナルド
Chapter 13 Web Application Infrastructure
Web Technology Solutions
Haritha Dasari Josue Balandrano Coronel -
PHP Training at GoLogica in Bangalore
Ruby, Rails, GUIs, and More
PHP / MySQL Introduction
Ruby on Rails by Manik Juneja
Ruby on Rails by Manik Juneja
SiteBuilder 2 Introduction.
An Introduction to JavaScript
Web Application Development Using PHP
Presentation transcript:

Ruby on Rails Web development that doesn’t hurt

Ruby on Rails Framework written in the Ruby programming language for database- backed web applications Utilizes MVC design pattern Created by David Heinemeier Hansson in mid 2003 and released in 2004 Developed to create the Basecamp project management web application

Philosophy Convention over configuration –Almost no configuration files –Helper scripts to get started Conformity through freebies –Magic wiring relies on common structures due to conventions of Ruby on Rails Best practices by invitation –Auto-generated unit and integration testing

Built-in Functions Helper scripts –Create directory hierarchy and skeleton code –Create model, view and controller objects –Set up database connectivity ActiveRecord –Dynamic method generation Built-in WEBrick web server

Ruby Object Oriented Scripting Language –Interpreted –Open Source –Fully OO that simulates procedurals –Created by Yukihiro Matsumoto (1993) –Publicly released in 1995 –New but well documented –Based loosely of Eiffel and Ada but heavily influenced by other languages like Perl, Python, Java/JavaScript, etc.

Reflective Language Ruby incorporates many beneficial features of other languages –Flexible programming (Perl) –Built in regex (Perl) –Error and Exception Handling (Python, Java) –Mark and Sweep Garbage Collector (Java) –No variable declaration (Perl, PHP, etc) –Embedded doc tools, RDoc (Java) –No Semicolon ‘;’ ! (Python) –Key word parameters *faked* (Python) –And many others

Highlights: Open Classes Every class, including the core classes can be modified at any time. You just need to call Class class_name #modification code End Example: #modding floats to output in currency class Float def to_m sprintf("$%.2f", self) end

Highlights: Embedded Strings In Perl and PHP you can embed variables into strings. In Ruby you can embed whole blocks of code into string. Just need to put it between #{ } Example: #print out the prices in currency format from an #array without the need to put it back into a #variable p = [1.25, 2.00, 3.15] print “Lily: #{p[0].to_m} Rose: #{p[1].to_m} Viola: #{p[2].to_m}”

Highlights: RHTML Ruby can be directly embedded into HTML much like the way PHP does Must have eruby (ERb) installed Trigger ERb with,, and tags Example: Names of all the people Name:

Future of Ruby Ruby is easy to learn, simple to understand and friendly to write in It has become quite popular and gained a large following since its release Ruby’s library is expanding rapidly with many modules currently being written for it. And with the soon to be release version 2.0 Not to mention it is completely free But will all this guarantee that the language won’t become obsolete once a new language comes out? It is left to be seen, as the language is too new, and its support not enough to become a standard

Rails and the MVC Pattern It is hard to develop with MVC in mind for most web applications using PHP/Perl/JSP. –Can be done, but requires a lot of work to create a framework to enforce the MVC pattern. –Although other frameworks already exist for Java (Struts), Perl (Maypole), and for PHP, they are not integrated deeply in their respective languages. This is bad because legacy systems may not be written with MVC in mind, resulting in spaghetti code.

Rails and the MVC Pattern RoR integrates and enforces MVC in its framework. Because of this most all applications written in RoR follow the MVC design pattern, and thus allowing for easier scalability and maintainability. This significantly reduces the amount of repeated code. RoR was designed with the Don’t Repeat Yourself philosophy in mind.

Model The Model in RoR wraps to represent the RDMBS tables used for a site. A very minimal amount of configuration needs to be done. All that needs to be configured is to tell configure where the database is sitting and the login information. Once the database is mapped, each table in the database is represented by its own class automatically. This allows ease of access without any further configuration. Based on the Active Record pattern.

View Uses embedded ruby code in.rhtml files. Similar to PHP and JSP...etc…

Controller The controller handles the logic, and responds to user interaction and manipulates the model. Out of the box, Rails provides the controller with prepackaged functions to easily perform CRUD (Create/Read/Update/Delete) operations on the model. No need to rewrite the same code over and again.

Putting it all together RoR requires minimal configuration for implementing MVC. Once a new RoR project is created, the framework will automatically create the MVC components. Each component will map to each other with little configuration.

AJAX on Rails Ability to incorporate AJAX (Asychronous JavaScript and XML) into Rails-driven sites Contains the Prototype JavaScript library –Works with AJAX functions –Works with Script.aculo.us (additional functionality onto Prototype) Contains helper functions for implementing AJAX –link_to_remote() –form_remote_tag() –observer_field()

AJAX on Rails No longer a complicated process to incorporate AJAX onto Rails-driven sites Newest version of Rails contains RJS –Integrated JavaScript templating language –Create JavaScript using Ruby –Use server-side variables to write JavaScript and update elements on the fly Reduce the amount of code needed to implement AJAX

Applications and Projects Applications –Instiki –TYPO Web pages –DRTV Research –Penny Arcade

Applications: Instiki Wiki-based program that focuses on ease of installation and simplicity in running –2 step method for install –Simplistic user interface –Great for notes, brainstorming, organizing gatherings, file sharing, etc. –Created by David Heinemeier Hansson, creator of Ruby on Rails Used for creating and editing web pages –RoR is the structure behind the code of Instiki –Used for database interaction, syntax interpretation, etc.

Applications: TYPO TYPO is a free, open source (MIT License) blogging engine written in the Ruby programming languge, using the Ruby on Rails web application framework Typo can use any of the various SQL databases supported by the Ruby on Rails framework Features include: –Do not need to rebuild the contents of the blog; everything is created on the fly –Uses caching –Web-based administration and posting interface, plus support for all three major external client API’s (Blogger, MetaWeblog and MovableType Extensions)

Web pages: DRTV Research DRTV Research is a free online application that combines television lineup listings per week with consumer demographic data for North America. Over 700,000 pages of data are available on DRTV Research with new data added daily. Ruby on rails provides the framework for the database interaction.

Web pages: Penny Arcade Penny Arcade is among the most popular web-comics currently online, hosting both a children's charity (Child’s Play) and a gaming convention (PAX) each year. Ruby on Rails framework used for the sites forums, and database interaction.

Ruby on Rails: Cons Confined to one language: Ruby Forced to one directory hierarchy Not too popular (Though it is becoming more so recently) Not yet industry standard Slight Learning Curve Relatively new with future stability unknown

Ruby on Rails: Pros Open Source! Built for Rapid Application Development Less development time Less lines of code Easy database connectivity MVC design pattern Built-in functions Minimal configuration Well documented AJAX made easy

Simplicity Weblog in 15 minutes – ke2_with_sound.movhttp://media.rubyonrails.org/video/rails_ta ke2_with_sound.mov Ruby search engine –