Tải bản đầy đủ (.pdf) (484 trang)

ruby on rails for microsoft developers

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (7.95 MB, 484 trang )

www.it-ebooks.info
Ruby on Rails
®
for Microsoft
®
Developers
subtitle
Updates, source code, and Wrox technical support at www.wrox.com
The Art of Rails
®
Edward Benson
Wrox Programmer to Programmer
TM
Updates, source code, and Wrox technical support at www.wrox.com
Professional
Ruby on Rails
Noel Rappin
Wrox Programmer to Programmer
TM
Enhance Your Knowledge
Advance Your Career
Professional ASP.NET 3.5 AJAX
978-0-470-39217-1
This book is for ASP.NET developers who are interested in using AJAX
to enhance existing web sites or develop new, more interactive web
applications.
Ruby on Rails for Microsoft Developers
978-0-470-37495-5
This book is for programmers who have experience developing the
Microsoft Windows platform and are interested in getting the most out
of Ruby on Rails.


Professional Ajax, 2nd Edition
978-0-470-10949-6
This book is for web developers who want to enhance the usability
of their sites and applications. Familiarity with JavaScript, HTML, and
CSS is necessary, as is experience with a server-side language such
as PHP or a .NET language.
Professional Ruby on Rails
978-0-470-22388-8
This book is for Ruby on Rails programmers, software and web devel-
opers, designers, and architects who are looking to expand their
knowledge of the Rails framework.
The Art of Rails
978-0-470-18948-1
This book is for developers familiar with Ruby on Rails who are looking
to advance their skills by learning the design and coding techniques
that enable a mastery of web application development with Rails.
Beginning Ruby on Rails
978-0-470-06915-8
This book is for anyone who wants to develop online applications using
Ruby and Rails. A basic understanding of programming is helpful;
some knowledge of HTML is necessary.
Beginning ASP.NET 2.0 AJAX
978-0-470-11283-0
This book is for developers and programmers who are starting to use
ASP.NET 2.0 AJAX framework technologies to build web sites and
applications.
Get more out of
WROX.com
Programmer to Programmer


Interact
Take an active role online by participating in
our P2P forums
Wrox Online Library
Hundreds of our books are available online
through Books24x7.com
Wrox Blox
Download short informational pieces and
code to keep you up to date and out of
trouble!
Chapters on Demand
Purchase individual book chapters in pdf
format
Join the Community
Sign up for our free monthly newsletter at
newsletter.wrox.com
Browse
Ready for more Wrox? We have books and
e-books available on .NET, SQL Server, Java,
XML, Visual Basic, C#/ C++, and much more!
Contact Us.
We always like to get feedback from our readers. Have a book idea?
Need community support? Let us know by e-mailing
spine=.96"
www.it-ebooks.info
Ruby on Rails
®
for Microsoft Developers
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii
Chapter 1: Getting Started with Rails . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Chapter 2: Understanding Rails . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Chapter 3: Ruby’s Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Chapter 4: Programming Ruby . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Chapter 5: A Working Sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Chapter 6: Incremental Development, Logging, and Debugging . . . . . . . . . . 197
Chapter 7: Object-Relational Mapping with ActiveRecord . . . . . . . . . . . . . . 233
Chapter 8: Handling Requests with ActionController . . . . . . . . . . . . . . . . . . 303
Chapter 9: Rendering the User Interface with ActionView . . . . . . . . . . . . . . 353
Chapter 10: ActiveResource and Web Services . . . . . . . . . . . . . . . . . . . . . . 383
Chapter 11: Going Into Production . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
Appendix A: Additional Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
74955book.indd Listi74955book.indd Listi 3/4/09 8:42:18 AM3/4/09 8:42:18 AM
www.it-ebooks.info
74955book.indd Listii74955book.indd Listii 3/4/09 8:42:19 AM3/4/09 8:42:19 AM
www.it-ebooks.info
Ruby on Rails
®
for Microsoft Developers
74955book.indd Listiii74955book.indd Listiii 3/4/09 8:42:19 AM3/4/09 8:42:19 AM
www.it-ebooks.info
74955book.indd Listiv74955book.indd Listiv 3/4/09 8:42:19 AM3/4/09 8:42:19 AM
www.it-ebooks.info
Ruby on Rails
®
for Microsoft Developers
Antonio Cangiano
74955book.indd Listv74955book.indd Listv 3/4/09 8:42:19 AM3/4/09 8:42:19 AM
www.it-ebooks.info
Ruby on Rails

®
for Microsoft Developers
Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright © 2009 by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-0-470-37495-5
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
Library of Congress Cataloging-in-Publication Data is available from the publisher.
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by
any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted
under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permis-
sion of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright
Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to
the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc.,
111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at
ey
.com/go/permissions
.
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or war-
ranties with respect to the accuracy or completeness of the contents of this work and specifi cally disclaim all
warranties, including without limitation warranties of fi tness for a particular purpose. No warranty may be
created or extended by sales or promotional materials. The advice and strategies contained herein may not
be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in
rendering legal, accounting, or other professional services. If professional assistance is required, the services
of a competent professional person should be sought. Neither the publisher nor the author shall be liable for

damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation
and/or a potential source of further information does not mean that the author or the publisher endorses the
information the organization or Web site may provide or recommendations it may make. Further, readers
should be aware that Internet Web sites listed in this work may have changed or disappeared between when
this work was written and when it is read.
For general information on our other products and services please contact our Customer Care Department
within the United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related
trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affi liates, in the
United States and other countries, and may not be used without written permission. Ruby on Rails is a reg-
istered trademark of David Heinemeier Hansson. All other trademarks are the property of their respective
owners. Wiley Publishing, Inc., is not associated with any product or vendor mentioned in this book.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not
be available in electronic books.
74955book.indd Listvi74955book.indd Listvi 3/4/09 8:42:19 AM3/4/09 8:42:19 AM
www.it-ebooks.info
For Jessica, my guiding star.
To my parents, Carmela and Ciro.
74955book.indd Listvii74955book.indd Listvii 3/4/09 8:42:19 AM3/4/09 8:42:19 AM
www.it-ebooks.info
74955book.indd Listviii74955book.indd Listviii 3/4/09 8:42:19 AM3/4/09 8:42:19 AM
www.it-ebooks.info
About the Author
Antonio Cangiano is a Software Engineer and Technical Evangelist at the IBM Toronto Software Lab.
He authored the initial ActiveRecord adapter for IBM DB2 and received an IBM Outstanding Technical
Achievement Award for his work with Rails. As a long-standing programmer, he has developed with
Microsoft .NET since its fi rst public beta, while maintaining a keen interest in multiple programming lan-
guages and technologies as well. He discovered Ruby and Ruby on Rails in 2004, immediately recognizing
their potential, and has adopted them as his favorite development tools ever since. Cangiano has contrib-
uted to books on the subject in both English and Italian, as well as to a few Open Source projects. You can

fi nd more of his writing on his blog, Zen and the Art of Programming (
).
74955book.indd Listix74955book.indd Listix 3/4/09 8:42:19 AM3/4/09 8:42:19 AM
www.it-ebooks.info
74955book.indd Listx74955book.indd Listx 3/4/09 8:42:19 AM3/4/09 8:42:19 AM
www.it-ebooks.info
Acquisitions Editor
Jenny Watson
Development Editors
Kelly Talbot
Gus A. Miklos
Sydney Jones
Technical Editor
Dr. Ian Piper
Production Editor
Kathleen Wisor
Copy Editor
Kim Cofer
Editorial Manager
Mary Beth Wakefi eld
Production Manager
Tim Tate
Vice President and Executive Group Publisher
Richard Swadley
Vice President and Executive Publisher
Barry Pruett
Associate Publisher
Jim Minatel
Project Coordinator, Cover
Lynsey Stanford

Compositor
Craig Woods, Happenstance Type-O-Rama
Proofreader
Jen Larsen, Word One
Nate Pritts, Word One
Indexer
J & J Indexing
Credits
74955book.indd Listxi74955book.indd Listxi 3/4/09 8:42:19 AM3/4/09 8:42:19 AM
www.it-ebooks.info
74955book.indd Listxii74955book.indd Listxii 3/4/09 8:42:19 AM3/4/09 8:42:19 AM
www.it-ebooks.info
Acknowledgments
Winston Churchill once said, “Writing a book is an adventure. To begin with, it is a toy and an amuse-
ment; then it becomes a mistress, and then it becomes a master, and then a tyrant. The last phase is that
just as you are about to be reconciled to your servitude, you kill the monster, and fl ing him out to the
public.” There is a lot of truth to those sentiments and I feel compelled to briefl y thank the people who
helped me “kill that monster,” as well as those who made the whole process enjoyable.
It has been my pleasure to work with the good folks at Wrox. In particular, I would like to thank Jenny
Watson for giving me the opportunity to write this book, my two development editors Kelly Talbot and
Sydney Jones for their advice and help with keeping me on track, and my technical editor Ian Piper,
as well as Gus Miklos, for their invaluable suggestions. I also would like to thank my manager Leon
Katsnelson, who fi rst brought the possibility of writing this book to my attention, and for his continu-
ous support.
I would like to express my gratitude to several people who helped me out in various ways; these friends
and world class programmers are (in alphabetical order): Piergiuliano Bossi, Ninh Bui, Marco Ceresa,
Paolo Corti, Giovanni Intini, Hongli Lai, Ludovico Magnocavallo, Carlo Miron, Lawrence Oluyede,
Gregg Pollack, and Valentino Volonghi. I can’t help but also thank Antani and Tarapia Tapioco. A huge
thank you goes straight to Marco Beri who was writing a book at the same time as I was writing mine.
I’d sometimes tease him by saying that he wasn’t as lucky as me, since his book wasn’t on Rails, but on

Django, a framework for the Python language. Inside jokes aside, our interaction via instant messaging
kept my spirits high and provided encouragement during the many long nights spent in front of a glow-
ing monitor. My appreciation also goes out to several people who kindly offered their help with review-
ing this book as it was being written. I’m sorry that time constraints and logistics didn’t allow for this. As
well, I can’t forget to mention Andrea Peltrin, a great Web designer who helped me improve the look and
feel of the sample blog application that was developed for Chapters 5 and 6. All the people mentioned
here did an amazing job in helping me to write the book you are holding, but I want to highlight how
any mistakes or shortcomings that may appear here are mine and mine alone, and are in no way repre-
sentative of these fi ne people’s work.
I feel it’s also important to acknowledge three people who didn’t work directly on this book, yet were
hugely infl uential in its coming to be. These are Yukihiro Matsumoto (a.k.a Matz), David Heinemeier
Hansson, and Dave Thomas. Matz invented the Ruby language, one of the most beautiful programming
languages out there. David created the Ruby on Rails framework, whose value will be revealed through-
out the book. And fi nally, Dave Thomas wrote some of the earliest available books on the subject of Ruby
and Rails. His work helped to popularize both of these and gave a large part of the programming public
the opportunity to learn about this pair of technologies. These three people affected my life more than
they will ever know, and for this I deeply respect and thank them.
74955book.indd Listxiii74955book.indd Listxiii 3/4/09 8:42:19 AM3/4/09 8:42:19 AM
www.it-ebooks.info
xiv
Acknowledgments
A sincere, heartfelt thank you goes to my unoffi cial editor, my wife Jessica, whose mastery of the
English language and craft of writing may only be surpassed by her patience, dedication, and beauty.
Though not a programmer, her help has been invaluable in improving the quality of this book. Writing
a book while maintaining a full-time day job and a regularly updated blog is a challenging task and an
effort that leaves little to no time for your family. So I must thank Jessica once again for being the unde-
manding, lovely companion who helped me maintain my sanity during these busy times.
In conclusion, I want to thank you, my readers. You are investing your time, money, and trust in this
book. For this I thank you and I want to reassure you that a great deal of care was placed into the
writing of this book, so as not to betray your trust.

74955book.indd Listxiv74955book.indd Listxiv 3/4/09 8:42:19 AM3/4/09 8:42:19 AM
www.it-ebooks.info
Contents
Introduction xxiii
GChapter 1: etting Started with Rails 1
The Rise and Challenges of Web Development 2
What Is Rails? 3
Open Source 3
Cross-Platform 4
Full-Stack 4
The MVC Pattern 4
Agile Development 5
Database Driven 6
Ruby: Rails’ Secret Sauce 7
Greater Than the Sum of Its Parts 7
A Brief History of Rails 8
Understanding Rails’ Origins 8
Powering the Web 2.0 10
The Rise of Ruby 10
Installing Rails 11
Can You Use Rails on Windows? 11
Installing on Windows 12
Confi guring Instant Rails 17
Installation on Other Platforms 19
RubyStack 21
Editors and IDEs 21
IDEs Are Helpful, Not Necessary 21
Popular Choices 22
TextMate: The King of Rails Editors 22
Vi and Emacs 24

NetBeans IDE 25
Aptana Studio and RadRails 25
Ruby In Steel: I Still Want Visual Studio 27
Whetting Your Appetite 29
Summary 31
74955book.indd Listxv74955book.indd Listxv 3/4/09 8:43:58 AM3/4/09 8:43:58 AM
www.it-ebooks.info
xvi
Contents
Understanding Rails 3Chapter 2: 3
Misconceptions about Rails 33
You Don’t Have to Be a Programmer 34
Rails Is a Silver Bullet 34
Rails Is Hard to Deploy 35
Rails Doesn’t Scale 35
Understanding MVC 36
Overview of the Architectural Pattern 36
Defi ning Models 38
Designing Views 41
Managing Controllers 42
Rails’ Standard Packages 44
Understanding Rails’ Main Principles 44
Convention over Confi guration 44
Don’t Repeat Yourself (DRY) 46
Rails vs. ASP.NET vs. ASP.NET MVC 47
A 10,000-Foot Comparison 48
ASP.NET MVC and Other .NET Frameworks 51
Summary 53
Ruby’s Data Types 5Chapter 3: 5
What’s Ruby? 55

Hello, Ruby! 56
Your New Best Friends 59
Interactive Ruby (IRB) 60
Ruby Interactive (RI) 61
Ruby’s Essential Data Types 63
Everything Is an Object 63
Identifi ers and Variables 64
Working with Numbers 67
Booleans 72
Strings 74
Symbols 77
Regular Expressions 77
Ranges 78
Arrays 79
Hashes 81
Summary 83
74955book.indd Listxvi74955book.indd Listxvi 3/4/09 8:43:58 AM3/4/09 8:43:58 AM
www.it-ebooks.info
xvii
Contents
Programming Ruby 8Chapter 4: 5
Defi ning Methods 85
Conditionals 88
if / elsif / else / unless 88
The Ternary Operator 90
The case Statement 91
Looping 93
The for/in Loop 93
The while and until Loops 94
Blocks and Iterators 95

Exception Handling 107
Raising Errors 109
Objects and Classes 111
Defi ning and Instantiating Classes 111
Attributes and Accessor Methods 112
Methods Visibility 116
Single Inheritance 117
Monkey Patching 120
Singleton Methods and Eigenclasses 121
Modules and Mixins 126
Modules Act as Namespaces 127
Modules Act as Mixins 129
Metaprogramming 131
Method Name Resolution 132
Alternative Ruby Implementations 133
Summary 134
A Working Sample 13Chapter 5: 5
Creating a New Rails Application 135
The rails Command 136
confi g\database.yml 137
Creating Databases 139
Scaffolding and Migrations 140
Migrations 140
Putting It All Together: Creating a Rails Application 146
A RESTful Application 151
What’s REST? 152
Mapping Routes to Actions 153
Named route Helpers 155
Analyzing the Model 156
74955book.indd Listxvii74955book.indd Listxvii 3/4/09 8:43:58 AM3/4/09 8:43:58 AM

www.it-ebooks.info
xviii
Contents
Analyzing the Controller 157
index 157
show 158
new 159
edit 160
create 160
update 161
destroy 162
Analyzing the View Layer 163
Rails’ Layouts vs. ASP.NET’s Master Pages 163
The articles.html.erb Layout 164
The index.html.erb Template 166
The new.html.erb Template 168
The edit.html.erb Template 170
The show.html.erb Template 171
Adding Partials 172
Adding Validations 174
Adding a Bit of Style 176
Setting a Default Time Zone 182
Adding Support for Textile 184
Using named_scope 188
Adding a Custom REST Action 191
Defi ning a Helper Method 192
More about Partials 193
Summary 196
Incremental Development, Logging, and Debugging 19Chapter 6: 7
Adding Pagination 197

Installing the will_paginate Plugin 198
Using the Plugin 198
Adding Comments 201
Defi ning Associations 204
Nested Resources 206
Adapting the Controller 207
Adapting the View Layer 211
Embedding Comments in Articles 215
Runtime Environments 221
Development 221
Test 222
Production 222
Your Own Environment 223
74955book.indd Listxviii74955book.indd Listxviii 3/4/09 8:43:58 AM3/4/09 8:43:58 AM
www.it-ebooks.info
xix
Contents
Logging 223
Using Logger 224
Redirecting Logging to the Console 226
Filtering Data 226
Debugging 227
Rails Directory Structure 230
Summary 231
Object-Relational Mapping with ActiveRecord 23Chapter 7: 3
Supported Databases 234
ActiveRecord Outside of Rails 235
Object-Relational Mapping 237
Generating Models 237
Generating Migrations 239

ORM Conventions 244
CRUD Operations 250
Create 250
Read 252
Update 265
Delete 269
ActiveRecord Associations 270
One-to-one Relationships 270
One-to-many Relationships 271
Many-to-many Relationships 271
Auto-generated Methods 273
Association Extensions 280
ActiveRecord Validations 281
Validation Helpers 283
Advanced ActiveRecord 284
Single Table Inheritance 284
Polymorphic Associations 286
Callbacks 289
Association Callbacks 292
Observers 292
Testing Models 294
Summary 301
Handling Requests with ActionController 30Chapter 8: 3
Defi ning Routes with map.connect 305
Default Parameters 305
74955book.indd Listxix74955book.indd Listxix 3/4/09 8:43:58 AM3/4/09 8:43:58 AM
www.it-ebooks.info
xx
Contents
Customizing Your Routes 306

Route Priority 309
Routes from the Console 310
Named Routes 311
RESTful Routes 312
map.resources 313
map.resource 314
Customizing RESTful Routes 315
Working with Controllers 319
Generating Controllers 320
Action Processing 321
Rendering 322
render 322
send_data and send_fi le 324
redirect_to 325
Accessing the Request and Response Environment 326
The request Object 327
Maintaining the State 329
Flash 330
Sessions 332
Session Storage Options 333
Enabling and Disabling Sessions 337
Session Expiration 338
Filters 339
Using Filters for HTTP Basic Authentication 342
Ideas for Improving the Authentication System 344
Testing Controllers 346
Testing Routes 346
Functional Testing 348
Summary 352
Rendering the User Interface with ActionView 35Chapter 9: 3

Working with Templates 353
Rendering Templates 353
Built-in Template Engines 357
ERb 357
Builder 358
RJS 359
Adding an RSS and Atom Feed 360
format.rss and format.atom 360
74955book.indd Listxx74955book.indd Listxx 3/4/09 8:43:58 AM3/4/09 8:43:58 AM
www.it-ebooks.info
xxi
Contents
index.rss.builder and index.atom.builder 361
Linking to the Feeds 366
Helpers 367
Predefi ned Helpers 368
Creating Helpers 376
Adding a Sprinkle of Ajax 377
Alternatives 381
Summary 382
ActiveResource and Web Services 38Chapter 10: 3
ActiveResource 383
Creating ActiveResource Models 384
CRUD Operations 385
Nested Resources 389
Consuming and Publishing REST Web Services from .NET 390
SOAP, XML-RPC, and ActionWebService 391
Summary 391
Going Into Production 39Chapter 11: 3
Security Considerations 393

Cross-Site Scripting (XSS) 394
SQL Injection 397
Protecting Your Records 398
Other Costly Mistakes 399
Ruby on Rails Security Guide 400
Performance and Optimization 400
Measuring Performance 400
Commercial Monitoring 404
Caching 406
Application-Level Performance Considerations 407
Deploying Rails 409
A Brief History of Deploying Rails 410
Deploying on Windows 412
Deploying on GNU/Linux 413
A Few Enterprise Pointers 414
Upgrading to Rails 2.3 415
Summary 416
74955book.indd Listxxi74955book.indd Listxxi 3/4/09 8:43:58 AM3/4/09 8:43:58 AM
www.it-ebooks.info
xxii
Contents
Additional Resources 41Appendix A: 7
HTML and JavaScript 417
HTML Links 417
JavaScript Links 417
Common Ajax Libraries and Frameworks 418
Ruby and Rails 418
Useful Links 418
Hosting Services 419
Getting Help 419

Recommended Books 420
Index 423
74955book.indd Listxxii74955book.indd Listxxii 3/4/09 8:43:58 AM3/4/09 8:43:58 AM
www.it-ebooks.info
Introduction
In July 2004 David Heinemeier Hansson released Ruby on Rails, a Web framework for the Ruby pro-
gramming language. It quickly gained momentum and became notorious for being a highly productive
Model-View-Controller (MVC) Web framework that was particularly well suited to Agile development.
Favoring sensible conventions over verbose confi guration fi les, Rails (as it is often called for short) aimed
to simplify and improve the lives of developers by allowing rapid prototyping of Web applications.
Fast-forward a few years, and Rails is now considered to be an established framework that has had a
signifi cant infl uence on the world of Web development. It inspired many other frameworks, helped boost
the popularity of dynamic programming languages on the Web, and has been used to implement some
of the largest sites that are out there today.
Despite Rails’ wide success and adoption, its community still remains Unix-centric, favoring Mac OS X,
GNU/Linux, or BSD variants over Microsoft Windows. Consequently the majority of books on the subject
and most of the literature you’ll fi nd online assume that you are using Unix-like operating systems and
tools. Though I personally use all of the operating systems I just mentioned, I believe that learning a new
language and framework can be challenging in its own right, so there is no need to make the whole expe-
rience more diffi cult by adding a new operating system and its ecosystem of tools to the learning curve.
Until today, if you were to approach Rails as a “Microsoft developer” you would most likely be in for a
culture shock. I felt compelled to change that by writing a book that helps bridge that cultural gap and
make the experience of learning Rails, when you have a Microsoft background, much less traumatic.
I attempt to be a friendly voice that can help you reach a better understanding of what Rails is and how
you can use it for your own projects, while utilizing tools you are (already) comfortable with, leveraging
your existing .NET or other Microsoft technologies skills, and understanding what caveats are associated
with developing Ruby on Rails applications on Windows.
Who This Book Is For
This book is introductory in nature and as such is intended for beginner to intermediate programmers.
Throughout the book I assume that you are somewhat familiar with object-oriented programming and

Web application development, but not with Ruby or Rails in particular.
If you are an absolute beginner you may fi nd some parts more challenging or obscure than others, but
you should still be able to grasp the gist of things and get a glimpse of the bigger picture of what Rails
can do for you. Conversely, if you are an experienced .NET developer, you’ll probably appreciate a few
in-depth considerations and the occasional comparison in the text, whenever similarities between the
two worlds exist.
I also assume that you’ll be using Windows, even though it is possible to follow along using any
operating system, because the commands and examples are cross-platform.
74955book.indd Listxxiii74955book.indd Listxxiii 3/4/09 8:44:19 AM3/4/09 8:44:19 AM
www.it-ebooks.info

×