Introduction to Ruby on Rails



Similar documents
A Tour of Ruby on Rails

Ruby on Rails. a high-productivity web application framework. blog.curthibbs.us/ Curt Hibbs <curt@hibbs.com>

ActiveRecord and Models. Model Associations. Migrations

Building and Deploying Web Scale Social Networking Applications Using Ruby on Rails and Oracle. Kuassi Mensah Group Product Manager

Ruby on Rails is a web application framework written in Ruby, a dynamically typed programming language The amazing productivity claims of Rails is

Rapid Application Development. and Application Generation Tools. Walter Knesel

1. Was ist das? II. Wie funktioniert das? III. Wo funktioniert das nicht?

Pete Helgren Ruby On Rails on i

Outline. Lecture 18: Ruby on Rails MVC. Introduction to Rails

Ruby On Rails. CSCI 5449 Submitted by: Bhaskar Vaish

Web Frameworks. web development done right. Course of Web Technologies A.A. 2010/2011 Valerio Maggio, PhD Student Prof.

Portals, Portlets & Liferay Platform

JAVA/J2EE DEVELOPER RESUME

WEB APPLICATION DEVELOPMENT. UNIT I J2EE Platform 9

Ruby on Rails. Object Oriented Analysis & Design CSCI-5448 University of Colorado, Boulder. -Dheeraj Potlapally

Cucumber: Finishing the Example. CSCI 5828: Foundations of Software Engineering Lecture 23 04/09/2012

Customer Bank Account Management System Technical Specification Document

Web Development Frameworks

Developing ASP.NET MVC 4 Web Applications Course 20486A; 5 Days, Instructor-led

Ruby On Rails. James Reynolds

Design Approaches of Web Application with Efficient Performance in JAVA

Ruby on Rails in GlassFish Sun Microsystems

CS169.1x Lecture 5: SaaS Architecture and Introduction to Rails " Fall 2012"

The Learn-Verified Full Stack Web Development Program

The NetBeans TM Ruby IDE: You Thought Rails Development Was Fun Before

Web Development with Grails

The full setup includes the server itself, the server control panel, Firebird Database Server, and three sample applications with source code.

Start up Jobs Germany FEB 2014

White Paper: 1) Architecture Objectives: The primary objective of this architecture is to meet the. 2) Architecture Explanation

Oracle Application Express MS Access on Steroids

Evaluation. Chapter 1: An Overview Of Ruby Rails. Copy. 6) Static Pages Within a Rails Application

Rails Cookbook. Rob Orsini. O'REILLY 8 Beijing Cambridge Farnham Koln Paris Sebastopol Taipei Tokyo

Eclipse Web Tools Platform. Naci Dai (Eteration), WTP JST Lead

Advanced Online Media Dr. Cindy Royal Texas State University - San Marcos School of Journalism and Mass Communication

This course provides students with the knowledge and skills to develop ASP.NET MVC 4 web applications.

Advanced Tornado TWENTYONE Advanced Tornado Accessing MySQL from Python LAB

Developing ASP.NET MVC 4 Web Applications MOC 20486

CSI 2132 Lab 8. Outline. Web Programming JSP 23/03/2012

How to Easily Integrate BIRT Reports into your Web Application

Developing ASP.NET MVC 4 Web Applications

Specialized Programme on Web Application Development using Open Source Tools

Dynamic website development using the Grails Platform. Joshua Davis Senior Architect Cognizant Technology Solutions

Brakeman and Jenkins: The Duo Detects Defects in Ruby on Rails Code

Setting up a local working copy with SVN, MAMP and rsync. Agentic

Google App Engine Data Store

<Insert Picture Here>

Introduction to Ruby on Rails

Case Study. Web Application for Financial & Economic Data Analysis Brainvire Infotech Pvt. Ltd Page 1 of 1

How to set up SQL Source Control. The short guide for evaluators

Business Intelligence Platform Quick Start Guide

Web development... the server side (of the force)

The IBM i on Rails + + Anthony Avison anthony@powerruby.com. Copyright 2014 PowerRuby, Inc.

Agile Best Practices and Patterns for Success on an Agile Software development project.

Visual Paradigm product adoption roadmap

Intruduction to Groovy & Grails programming languages beyond Java

Grails 1.1. Web Application. Development. Reclaiming Productivity for Faster. Java Web Development. Jon Dickinson PUBLISHING J MUMBAI BIRMINGHAM

Web Development with the Eclipse Platform

Jaspersoft APIs. Integrating BI with your Applications. Community and Professional Editions

Web Programming Languages Overview

<Insert Picture Here> Michael Hichwa VP Database Development Tools Stuttgart September 18, 2007 Hamburg September 20, 2007

Jenkins User Conference Herzelia, July #jenkinsconf. Testing a Large Support Matrix Using Jenkins. Amir Kibbar HP

NetBeans IDE Field Guide

Java/J2EE or Web Developer. Formal Education. Technical knowledge. Spoken Languages

This document gives an outline of Tim Ward s work on mobile phone systems

Master Thesis in software Engineering and Management Model Driven Development with Ruby on Rails Antonios Protopsaltou Göteborg, Sweden 2004

Web/Mobile Applications Principles

Grails: Accelerating J2EE Application Development

Research Article. ISSN (Print) *Corresponding author Lili Wang

Acano solution. Acano Manager R1.1 FAQs. Acano. December G

Accessing Data with ADOBE FLEX 4.6

Example. Represent this as XML

DTWMS Required Software Engineers. 1. Senior Java Programmer (3 Positions) Responsibilities:

Toad for Data Analysts, Tips n Tricks

OXAGILE RESUMES SUMMARY OF QUALIFICATIONS TECHNICAL SKILLS SENIOR JAVA SOFTWARE ENGINEER

RESTful Rails Development. translated by Florian Görsdorf and Ed Ruder

Building Dynamic Websites With the MVC Pattern. ACM UIUC, 2010

Drupal CMS for marketing sites

Reverse proxy for Tomcat Project Plan

Oracle Forms Services Secure Web.Show_Document() calls to Oracle Reports

SAP NetWeaver Opens SAP ERP world. Amedeo Prodi SAP Italia

Continuous Integration

Beginning POJOs. From Novice to Professional. Brian Sam-Bodden

Oracle Application Development Framework Overview

Romulus, Java Web Development made productive.

An Introduction to Data Virtualization as a Tool for Application Development

In this chapter, we lay the foundation for all our further discussions. We start

Oracle WebLogic Foundation of Oracle Fusion Middleware. Lawrence Manickam Toyork Systems Inc

Complete Java Web Development

Modern Software Development Tools on OpenVMS

Getting Started with Telerik Data Access. Contents

An introduction to creating JSF applications in Rational Application Developer Version 8.0

What is a database? COSC 304 Introduction to Database Systems. Database Introduction. Example Problem. Databases in the Real-World

If you wanted multiple screens, there was no way for data to be accumulated or stored

Hudson Continous Integration Server. Stefan Saasen,

Client-server 3-tier N-tier

FileMaker Server 12. FileMaker Server Help

Abdullah Radwan. Target Job. Work Experience (9 Years)

Lecture 10 Fundamentals of GAE Development. Cloud Application Development (SE808, School of Software, Sun Yat-Sen University) Yabo (Arber) Xu

Quick start. A project with SpagoBI 3.x

Case Study. Data Governance Portal Brainvire Infotech Pvt Ltd Page 1 of 1

Transcription:

Introduction to Ruby on Rails Welcome to the puzzle.it s a fun ride! By Steve Keener

Terms you will hear Full stack Active Record Object Relational Model (ORM) MVC Gems RHTML Migration SVN

What is RoR? It s the next best thing to sliced bread? It s the silver bullet to fix our project? It s magic? None of these things. It s a tool. But it was conceived as a highly productive tool where DRY is paramount. Don t Repeat Yourself.

Things you will need Ruby (Language) Rails (Framework in Ruby) Database Start here: www.rubyonrails.org/down You can download Instant Rails (Windows only). It contains Ruby, Rails, and MySQL for trying out the RoR world. You would use the command line and text editors to create applications.

Available Development IDEs RadRails Eclipse-based, integrated generators & servers. http://www.radrails.org/ TextMate Mac oriented http://www.macromates.com/ I use RadRails. Downside is that code generators are still command line. But that s a minor drawback.

Source Code Repositories CVS Doesn t seem to be the preferred repository. Haven t found an integrated delivery system. I used simple Ant scripts to build my delivery processes. SVN Preferred repository and is integrated with Capistrano. (Rails version of application delivery systems.)

After that The first place to start the journey is by reading the article Rolling with Ruby on Rails by Curt Hibbs. http://www.onlamp.com/pub/a/onlamp/20 05/01/20/rails.html

Then what? You should pick up two books: Agile Web Development with Rails (Excellent) Rails Recipes (Great for finding specific functional modules you might need and having them running in an hour.)

Other resources Rails online API http://api.rubyonrails.org/ Ruby Forums http://www.ruby-forum.com/user/login RubyForge http://rubyforge.org/

On to Rails Object Relational Mapping: ActiveRecord Like Java s Hibernate (but simpler) Takes away a lot of the drudgery associated with web applications. (Create, Retrieve, Update, and Delete functions.)

Full Stack Rails J2EE Webrick or Mongrel Tomcat Servlet Container DispatchServlet ActionServlet ActionController RHTML Action Action Form JSP ActiveRecord Hibernate Database Layer Database Layer Yes they are fairly comparable. Note: Found diagram on web

Or another way to put it

Or maybe this way

Rails vs J2EE Both have a learning curve RAILS has the edge in productivity by a significant margin. J2EE currently has an edge in scalability. If it s a client facing system for millions of concurrent users use J2EE. If it s an internal web application, definitely take a look at this technology as a possible way of shortcutting the long development time for a J2EE web app.

Can t afford the time to learn a new framework!!! I needed a few screens to manage some dev data. Was investigating several different technologies to see what would best serve the need and timeframe. (J2EE, Hibernate, JSF, Rails, etc) Day 1 - Picked up a Ruby On Rails book, read a few articles, started experimenting. Day 2 - Stated building a few screens, relying on dynamic scaffolding for basic CRUD functionality Day 3 - Began replacing scaffold screens with better looking ones by hand. Day 4 Started adding layouts, CCS, and some AJAX functionality to make application a bit nicer. Day 5 Began investigating Models, Migrations, and RJS templates to enhance productivity. 5 days from start, over 50 screens produced, far more functionality than I had been planning, demos to multiple managers, and more than a few headaches. It s not perfect, but is certainly a useful tool. (NOT A SILVER BULLET!!!!!!)

Database New term Migration: A powerful and flexible tool for managing database changes Allows table, index, and data creation scripts to be run in multiple environments with a very simple syntax. Need to revert back to a previous DB version to work on a bug? 1 command. Then refresh it back to the current dev version? 1 command.

Example Migration class CreateMenuitems < ActiveRecord::Migration def self.up # Create the Menuitems table. The ID field does not need to be specified automagically created. create_table :menuitems do t t.column :href, :string, :limit => 75 t.column :title, :string, :limit => 75 t.column :desc, :string, :limit => 75 t.column :leadtag, :string, :limit => 25 t.column :endtag, :string, :limit => 25 end item = Menuitem.create(:href => "/menu/zero_dollars.html", :title => "Zero dollar page1", :desc => "Zero dollar ads1", :leadtag => "<li>", :endtag => "</li>") item.save end end def self.down drop_table :menuitems end

MVC Model / View / Controller Model Used for persistence and relationships View Used for displaying the data Controller The logic of the application

Example Model class Node < ActiveRecord::Base end Yes.that s it. Rails queries the database and determines the datatypes and fields for you. You can add data relationships, data validations to the model later. This is enough to get the scaffold screens up and running.

Example View (With AJAX functionality thrown in) <h1>listing nodes</h1> <table> <tr> <th>desc</th> <th>create date</th> <th>status</th> </tr> <% @nodes.each do n %> <tr> <td> <%= @node = n; n; in_place_editor_field :node, :desc, {}, {:url => '/node/node_update_desc/' << @node.id.to_s, :rows => 1, 1, :cancellink => 'false'} %> </td> <td width="50%" align="center"><%= n.created_at %></td> <td width="50%" align="center"><%= n.status %></td> </tr> <% end %> </table>

Example Controler def list @nodes = Node.find(:all) end - Uses the ActiveRecord Object Relational Mapping capabilities to pull all of the nodes in the Nodes table. No SQL written here to cause problems.

Rails/Ruby conventions Ruby Gems Like Java Jar files. Packages that can be installed. Taken one step further simple installation methodologies. Convention over configuration. Use the Rails Way. The framework is designed to make development fast and easy. RHTML - HTML files with embedded Ruby/Rails code. Preprocessed into HTML

Resources Rails API http://api.rubyonrails.org/ CSS Menus http://www.cssplay.co.uk/menus/index.html Live DataGrid http://unspace.ca/discover/datagrid/

More Subversion http://subversion.tigris.org/ Data Relationships diagram http://mboffin.com/stuff/ruby-on-rails-data-relationships.png Cheatsheets http://www.rubyonrailsblog.com/files/rorblog-cheatsheet.pdf

Cheatsheets Migration http://garrettsnider.backpackit.com/pub/367902 Rails http://www.rubyonrailsblog.com/files/rorblog-cheatsheet.pdf Webservices on Rails http://manuals.rubyonrails.com/read/book/10 WebCast How-To site http://peepcode.com/

Summary It s an evolving toolset. DRY leads to fewer lines of code. Less code should mean less chances for bugs. Still requires normal analysis to be done on a project. But you can react far quicker to changes in requirements. A great tool for your toolbox.