Ruby on Rails for PHP and Java Developers

Similar documents
Contents. Contents... XI

Contents in Detail. Foreword by Xavier Noria

"Charting the Course... SharePoint 2007 Hands-On Labs Course Summary

Agile Web Development with Rails 5

Django with Python Course Catalog

Oracle BI Publisher 11g R1: Fundamentals

"Charting the Course... MOC A Developing Data Access Solutions with Microsoft Visual Studio Course Summary

Getting. Started with. smash. IBM WebSphere. Ron Lynn, Karl Bishop, Brett King

"Charting the Course... MOC Programming in C# with Microsoft Visual Studio Course Summary

BTA Billing Online Support Statement File Reference Guide

Advanced Joomla! Dan Rahmel. Apress*

"Charting the Course... MOC A Introduction to Web Development with Microsoft Visual Studio Course Summary

"Charting the Course... MOC A Configuring and Deploying a Private Cloud with System Center Course Summary

"Charting the Course... MOC B Updating Your SQL Server Skills to Microsoft SQL Server 2014 Course Summary

Enterprise Reporting. 1 enterpri. Oracle Bl Publisher 11 g: A Practical Guide to. Enterprise data using Oracle Bl Publisher 11g

"Charting the Course to Your Success!" MOC Planning, Deploying and Managing Microsoft System Center Service Manager 2010.

TABLE OF CONTENTS CHAPTER TITLE PAGE

II.1 Running a Crystal Report from Infoview

"Charting the Course... MOC B Developing Microsoft SharePoint Server 2013 Core Solutions. Course Summary

Pro ASP.NET MVC 2 Framework

This course is designed for web developers that want to learn HTML5, CSS3, JavaScript and jquery.

Enterprise Content Management Systems on the example of Alfresco

Introduction to PTC Windchill PDMLink 11.0 for Heavy Users

Java.. servlets and. murach's TRAINING & REFERENCE 2ND EDITION. Joel Murach Andrea Steelman. IlB MIKE MURACH & ASSOCIATES, INC.

"Charting the Course... Java Programming Language. Course Summary

WEB-201. Welcome Thanyapon Sananakin MCSA, MCITP, MS Insider

iflame INSTITUTE OF TECHNOLOGY

INSTITUTE OF TECHNOLOGY AND ADVANCED LEARNING SCHOOL OF APPLIED TECHNOLOGY COURSE OUTLINE ACADEMIC YEAR 2012/2013

Beginning Groovy, Grails and Griffon. Vishal Layka Christopher M. Judd Joseph Faisal Nusairat Jim Shingler

A Web-Based Introduction

IBM Tivoli Federated Identity Manager Version Installation Guide GC

Acknowledgments...iii

"Charting the Course... MOC /2: Planning, Administering & Advanced Technologies of SharePoint Course Summary

Flask Web Development Course Catalog

Java EE Patterns. Student Guide - Volume 1. SL-500 Rev C.0.1. D61856GC10 Edition 1.0 D62465

Introduction to PTC Windchill PDMLink 11.0 for the Implementation Team

Web Development with Java

Full Stack Web Developer

Hyperion System 9 Financial Management release

Understanding the Concepts and Features of Macro Programming 1

Programming Windows Azure

Murach s Beginning Java with Eclipse

Adobe Experience Manager

Introduction to PTC Windchill ProjectLink 11.0

Developing Web Applications

Hyperion System 9 Strategic Finance release

"Charting the Course... Intermediate PHP & MySQL Course Summary

IN PRACTICE. Daniele Bochicchio Stefano Mostarda Marco De Sanctis. Includes 106 practical techniques MANNING

Pro Hibernate and. MongoDB. Anghel Leonard. Apress-

Contents at a Glance. vii

Web Application Expectations

"Charting the Course... MOC C: Querying Data with Transact-SQL. Course Summary

"Charting the Course... MOC D Configuring Windows 8.1 Course Summary

Contents. Deployment: Automated Installation of Cygwin

Overview 14 Table Definitions and Style Definitions 16 Output Objects and Output Destinations 18 ODS References and Resources 20

Step 1: Download the Overdrive Media Console App

2 Webpage Markup with HTML HTML5 Page Structure Creating a Webpage HTML5 Elements and Entities

SharePoint 2013 Central Administration

Federated Identity Manager Business Gateway Version Configuration Guide GC

International Journal of Advance Research in Engineering, Science & Technology. Study & Analysis of SOA based E-Learning Academic System

Web Portfolio Design and Applications

Webservices In Java Tutorial For Beginners Using Netbeans Pdf

CHAPTER 1 PREFACE... 1

Automation through Chef Opscode

Unlocking the Power. of OPNET Modeler WM CAMBRIDGE ZHENG LU HONGJI YANG UNIVERSITY PRESS

About the Authors. Preface

"Charting the Course B Configuring, Managing and Troubleshooting Microsoft Exchange Server 2010 Course Summary

"Charting the Course... MOC B Active Directory Services with Windows Server Course Summary

Mastering phpmyadmiri 3.4 for

System Administration of PTC Windchill 11.0

Full version is >>> HERE <<<

About This Book... ix About The Author... xiii Acknowledgments...xv Chapter 1: Why Custom Tasks... 1

"Charting the Course... MOC A: Developing with the SharePoint Framework. Course Summary

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

"Charting the Course to Your Success!" MOC D Installing and Configuring Windows Server Course Summary

Hyperion System 9 BI+ Analytic Services

Contents. Tutorials Section 1. About SAS Enterprise Guide ix About This Book xi Acknowledgments xiii

WebSphere Commerce Enterprise Commerce Professional

JVA-563. Developing RESTful Services in Java

CITY UNIVERSITY OF NEW YORK. Creating a New Project in IRBNet. i. After logging in, click Create New Project on left side of the page.

Pro MongoDB Development

Simon Wosko Phone: Site: Summary Skills Programming Languages Software Database Platforms Utilities SIMON WOSKO 1

"Charting the Course... MOC A: Administering System Center Configuration Manager. Course Summary

Installing SharePoint Server 2007

"Charting the Course... MOC A: SharePoint 2016 Site Collections and Site Owner Administration. Course Summary

Contents at a Glance

"Charting the Course... MOC C: Deploying and Managing Windows 10 Using Enterprise Services. Course Summary

Level: M.Ed. Credit Hour: 3 (2+1) Semester: Third Teaching Hour: 80(32+48)

The Unofficial Guide to Creating Reports In Crystal using your Pastel Data

"Charting the Course... MOC B Core Solutions of Microsoft Skype for Business Course Summary

Programming the World Wide Web by Robert W. Sebesta

COGNOS BI I) BI introduction Products Introduction Architecture Workflows

Using Data Science to deliver Workforce & Labour Market Insights. Gary Gan Co-Founder, JobKred

BFW-037 B.Sc. FOOTWEAR TECHNOLOGY (BSCFWT) Term-End Examination. December, 2014

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

Ryan Stephens. Ron Plew Arie D. Jones. Sams Teach Yourself FIFTH EDITION. 800 East 96th Street, Indianapolis, Indiana, 46240

PROFESSIONAL. NoSQL. Shashank Tiwari WILEY. John Wiley & Sons, Inc.

Contents. Acknowledgments

"Charting the Course to Your Success!" MOC Microsoft SharePoint 2010 Site Collection and Site Administration Course Summary

McAfee Content Security Reporter 2.6.x Migration Guide

Transcription:

Deepak Vohra Ruby on Rails for PHP and Java Developers With 202 Figures and 32 Tables Springer

Contents Preface Motivation for this Book Who Should Read this Book? Outline to the Book Structure Prerequisite Skills Acknowledgements About the Author Contents V V VI VII VIII VIII VIII XI lruby 1 1.1 Introduction 1 1.2 Installing Ruby 1 1.3 Creating a Ruby Application 3 1.4 Identifiers and Comments 5 1.5 Strings 6 1.6 Arrays Hashes and Ranges...8 1.7 Variables Constants and Operators 11 1.8 Classes 16 1.9 Methods 18 1.10 Procs and Blocks 24 1.11 Control Structures and Iterators 28 1.12 Exception Handling 33 1.13 Modules 36 1.14 Comparing Ruby with PHP 36 1.15 Comparing Ruby with Java 37 1.16 Summary 39 2 Rails Framework. 41 2.1 Introduction 41 2.2 Overview of Rails 41 2.3 Active Record 43 2.4 Action Controller 47

XII Contents 2.5 Action View 50 2.5.1 Sub-Templates 52 2.6 Ruby on Rails Commands 52 2.7 Installing Rails 53 2.8 Developing a Rails Application 54 2.9 Rails Routes 56 2.10 Stylesheets 57 2.11 Helpers 57 2.12 Layouts 58 2.13Partials 60 2.14 Rails Framework Examples 61 2.15 Configuring Rails with the MySQL Database 67 2.16 Comparing Rails with PHP 69 2.17 Comparing Rails with Java 69 2.18 Summary 69 3 CRUD on Rails 71 3.1 Introduction 71 3.2 Scaffolding 71 3.3 CRUD with PHP 72 3.4 CRUD with Java 74 3.5 Creating a Rails Application 75 3.6 Creating a Database Table 76 3.7 Migrations 77 3.8 Creating catalogs Table with Migrations 82 3.9 Configuring with Oracle Database 84 3.10 Configuring with SQL Server 2005 Database 85 3.11 Developing a CRUD Application 86 3.11.1 Creating Dynamic Scaffolding 87 3.11.2 Creating Scaffolding with Scaffold Generator 88 3.12 Ajax Scaffolding 95 3.13 Validations 100 3.14 Summary 106 4 Ajax on Rails 107 4.1 Introduction "".."""..."" 1 7 4.2 Overview of Ajax I.!!!""""!!!"!!!!""!!!!!.! 107 4.3 Overview of XMLHttpRequest 1 8 4.4 Creating an XMLHttpRequest Object."!.'.."."."..."!" U 4.5 Opening an HTTP Request HO 4.6 Sending an HTTP Request.I...".. I 11 11! 4.7 Processing an HTTP Response ZZ'ZZ"."".'.".

Ruby on Rails for PHP and Java Developers XIII 4.8 Ajax with PHP 113 4.9 Ajax with Java 113 4.10 Support for Ajax in Rails 114 4.10.1 linktoremote 116 4.10.2 formremotejag...117 4.10.3 submit_to_remote 117 4.10.4 observefield 118 4.10.5 observeform 119 4.10.6 periodicallycallremote 119 4.10.7 updateelementfunction 119 4.10.8 updatejage 120 4.11 Creating a Ruby on Rails Application 120 4.12 Creating a Database Table 121 4.13 Sending a Request 124 4.13.1 Sending a Request with formremotetag Method 125 4.13.2 Sending a Request with observefield Method 127 4.14 Processing a Request 128 4.15 Processing the Response 135 4.16 Summary 142 5 Creating PDF and Excel Reports 143 5.1 Introduction 143 5.2 Creating a PDF with PHP 144 5.3 Creating a PDF with Java 144 5.4 Creating a PDF File with Ruby on Rails 145 5.5 Creating a Table in PDF 149 5.6 Creating a Spreadsheet with PHP 155 5.7 Creating a Spreadsheet with Java 156 5.8 Creating an Excel Spreadsheet with Ruby on Rails 157 5.9 Creating a Spreadsheet with Ruby Spreadsheet 167 5.10 Summary 172 6 XML On Rails 173 6.1 Introduction - 173 6.2 Processing XML with PHP 5 173 6.3 Processing XML with Java 174 6.4 Installing XML Builder 175 6.5 Creating an XML Document with Ruby on Rails., 176 6.6 Creating an XML Document from a Database 180 6.7 Parsing an XML Document with REXML 184 6.8 Summary 189

XIV Contents 7 PHP On Rails 191 7.1 Introduction 191 7.2 Installing PHP 191 7.3 Installing PHPOnTrax 192 7.4 Creating a Trax Application 193 7.5 Creating a CRUD Application 197 7.6 Summary 207 8 LDAP On Rails 209 8.1 Introduction 209 8.2 Installing OpenLDAP 210 8.3 Installing Tivoli Directory Server 216 8.4 Installing Oracle Internet Directory 232 8.5 LDAP with PHP 247 8.6 LDAP with Java 248 8.7 Installing NET: :LDAP 250 8.8 Creating a Rails Application 252 8.9 Creating a Directory Entry 253 8.10 Modifying a Directory Entry 260 8.11 Searching a Directory 263 8.12 Deleting a Directory Entry 267 8.13 Summary 273 9 Web Services On Rails 275 9.1 Introduction 275 9.2 Web Services with PHP 275 9.3 Web Services with Java 276 9.4 Creating a Web Service with Ruby on Rails 278 9.5 Web Service API Class 284 9.6 Dispatching 285 9.6.1 Direct Dispatching 285 9.6.2 Delegated Dispatching 286 9.6.3 Layered Dispatching 290 9.7 Protocol Clients " 290 9.8 Summary 299 10 Ruby on Rails in Eclipse 301 10.1 Introduction *..301 10.2 PHP in Eclipse \ZZZZZZZZZZZZZZZZZZZZZ'.30\ 10.3 Installing RDT Z..ZZZZZ. Z'ZZ. 302 10.4 Creating a Rails Project in RDT ZZZZZZZZZ. 303 10.5 Creating a Database Table with RDTZ"ZZZZZZ.! 309

Ruby on Rails for PHP and Java Developers XV 10.6 Creating a CRUD Application with RDT 313 10.7 Installing RadRails 316 10.8 Creating a Rails Application with RadRails 318 10.9 Creating a CRUD Application with RadRails 320 10.10 Summary 323 11 Rails Testing and Fixtures 325 11.1 Introduction 325 11.2 Unit Testing in PHP and Java 325 11.3 Rails Example Test 326 11.4 Assertion Types 331 11.5 Rails Testing 335 11.6 Fixtures 336 11.7 Unit Testing 337 11.8 Testing Controllers 342 11.9 Summary 349 12 Rails in Production 351 12.1 Introduction 351 12.2 Setting the Production Mode 351 12.3 Rails Best Practices and Performance...352 12.4 Deployment on Apache2 and FastCGI 354 12.5 Rails Web Hosting 360 12.6 Summary 387 Sources of Information 389 Index 391