Synopses & Reviews
Ready to learn Rails? Get up to speed using the frameworks latest release. In this Live Edition, Learning Rails has been updated to cover Rails 2.3.5, making it an ideal guide for Rails beginners.
Unlike most Rails books, Learning Rails is for web developers, and not for programmers. Rather than begin with the inner layers of a Rails web application -- the models and controllers -- this book approaches Rails development from the outer layer: the view side of an application. Youll start from the foundations of the Web you already know, and learn how to create something visible with Rails before reaching the more difficult database models and controller code. Each chapter includes exercises and review questions so you can test your understanding as you go.
- Present content by building an application with a basic view and a simple controller, while learning Ruby along the way
- Build forms and process their results, progressing from simple to more complex
- Connect forms to models by setting up a database, and use Rails Active Record to create code that maps to database structures
- Use Rails scaffolding to build applications from a view-centric perspective
- Add common web application elements such as sessions, cookies, and authentication
- Build applications that combine data from multiple tables
- Create simple but dynamic interfaces with Rails and Ajax
O'Reilly Live Edition books give you access to updates to topics in between editions of a book. A Live Edition is an electronic and print-on-demand version of the book that is updated when there is a significant change to the software or technology the book covers, keeping you on top of .X releases or major fixes.Synopsis
Ready to learn Rails? Get up to speed using the framework's latest release. In this Live Edition, Learning Rails has been updated to cover Rails 2.3.5, making it an ideal guide for Rails beginners.
Unlike most Rails books, Learning Rails is for web developers, and not for programmers. Rather than begin with the inner layers of a Rails web application -- the models and controllers -- this book approaches Rails development from the outer layer: the view side of an application. You'll start from the foundations of the Web you already know, and learn how to create something visible with Rails before reaching the more difficult database models and controller code. Each chapter includes exercises and review questions so you can test your understanding as you go. Present content by building an application with a basic view and a simple controller, while learning Ruby along the way Build forms and process their results, progressing from simple to more complex Connect forms to models by setting up a database, and use Rails' Active Record to create code that maps to database structures Use Rails scaffolding to build applications from a view-centric perspective Add common web application elements such as sessions, cookies, and authentication Build applications that combine data from multiple tables Create simple but dynamic interfaces with Rails and Ajax O'Reilly Live Edition books give you access to updates to topics in between editions of a book. A Live Edition is an electronic and print-on-demand version of the book that is updated when there is a significant change to the software or technology the book covers, keeping you on top of .X releases or major fixes.
Synopsis
The Live Edition of Learning Rails starts with an update of the book from Rails 2.1.1 to Rails 2.3.5. Code that changed over the past year or so has been cleaned up, as have errata that shouldn't have been there in the first place. Easy approaches to installing Rails that proved to be dead ends have been removed, while new material on jQuery has been added. The text has also been improved to make fewer assumptions that readers have gone through it in sequence, with reminders added about steps whose omission can cause strange problems. The forward-looking sections of the book include more recent information about the upcoming Rails 3.
O'Reilly Live Edition books give you access to updates to topics in between editions of a book. A Live Edition is an electronic version of the book that is updated when there is a significant change to the software or technology the book covers, keeping you on top of .X releases or major fixes.
About the Author
Simon St. Laurent is a web developer, network administrator, computer book author, and XML troublemaker living in Ithaca, NY. His books include XML: A Primer, XML Elements of Style, Building XML Applications, Cookies, and Sharing Bandwidth. He is a contributing editor to XMLhack.com and an occasional contributor to XML.com.
Edd Dumbill is co-chair of the O'Reilly Open Source Convention. He is also chair of the XTech web technology conference. Edd conceived and developed Expectnation, a hosted service for organizing and producing conferences. Edd has also been Managing Editor for XML.com, a Debian developer, and GNOME contributor. He writes a blog called Behind the Times.
Table of Contents
Preface; Who This Book Is For; Who This Book Is Not For; What You'll Learn; Ruby and Rails Style; Other Options; Rails Versions; If You Have Problems Making Examples Work; If You Like (or Don't Like) This Book; Conventions Used in This Book; Using Code Examples; How to Contact Us; Acknowledgments; Chapter 1: Starting Up Ruby on Rails; 1.1 Getting Started at the Command Line; 1.2 What Server Is That?; 1.3 Test Your Knowledge; Chapter 2: Rails on the Web; 2.1 Creating Your Own View; 2.2 What Are All Those Folders?; 2.3 Adding Some Data; 2.4 How Hello World Works; 2.5 Protecting Your View from the Controller; 2.6 Parentheses Are (Usually) Optional; 2.7 Adding Logic to the View; 2.8 Test Your Knowledge; Chapter 3: Adding Web Style; 3.1 I Want My CSS!; 3.2 Layouts; 3.3 Setting a Default Page; 3.4 Test Your Knowledge; Chapter 4: Controlling Data Flow: Controllers and Models; 4.1 Getting Started, Greeting Guests; 4.2 Application Flow; 4.3 Keeping Track: A Simple Guestbook; 4.4 Finding Data with ActiveRecord; 4.5 Test Your Knowledge; Chapter 5: Accelerating Development with Scaffolding and REST; 5.1 A First Look at Scaffolding; 5.2 REST and Controller Best Practices; 5.3 Examining a RESTful Controller; 5.4 Escaping the REST Prison; 5.5 Test Your Knowledge; Chapter 6: Presenting Models with Forms; 6.1 More Than a Name on a Form; 6.2 Generating HTML Forms with Scaffolding; 6.3 Form As a Wrapper; 6.4 Creating Text Fields and Text Areas; 6.5 Creating Checkboxes; 6.6 Creating Radio Buttons; 6.7 Creating Selection Lists; 6.8 Dates and Times; 6.9 Labels; 6.10 Creating Helper Methods; 6.11 Putting the Form Body in a Partial; 6.12 Test Your Knowledge; Chapter 7: Strengthening Models with Validation; 7.1 Without Validation; 7.2 The Original Model; 7.3 The Power of Declarative Validation; 7.4 Managing Secrets; 7.5 A Place on the Calendar; 7.6 Beyond Simple Declarations; 7.7 Test Your Knowledge; Chapter 8: Improving Forms; 8.1 Adding a Picture by Uploading a File; 8.2 Standardizing Your Look with Form Builders; 8.3 Test Your Knowledge; Chapter 9: Developing Model Relationships; 9.1 Connecting Awards to Students; 9.2 Connecting Students to Awards; 9.3 Nesting Awards in Students; 9.4 Many-to-Many: Connecting Students to Courses; 9.5 What's Missing?; 9.6 Test Your Knowledge; Chapter 10: Managing Databases with Migrations; 10.1 What Migrations Offer You; 10.2 Migration Basics; 10.3 Inside Migrations; 10.4 Test Your Knowledge; Chapter 11: Debugging; 11.1 Creating Your Own Debugging Messages; 11.2 Logging; 11.3 Working with Rails from the Console; 11.4 The Ruby Debugger; 11.5 Test Your Knowledge; Chapter 12: Testing; 12.1 Test Mode; 12.2 Setting Up a Test Database with Fixtures; 12.3 Unit Testing; 12.4 Functional Testing; 12.5 Integration Testing; 12.6 Beyond the Basics; 12.7 Test Your Knowledge; Chapter 13: Sessions and Cookies; 13.1 Getting Into and Out of Cookies; 13.2 Storing Data Between Sessions; 13.3 Test Your Knowledge; Chapter 14: Users and Authentication; 14.1 Installation; 14.2 Storing User Data; 14.3 Controlling Sessions; 14.4 Classifying Users; 14.5 More Options; 14.6 Test Your Knowledge; Chapter 15: Routing; 15.1 Creating Routes to Interpret URIs; 15.2 Generating URIs from Views and Controllers; 15.3 Infinite Possibilities; 15.4 Test Your Knowledge; Chapter 16: Creating Dynamic Interfaces with Rails and Ajax; 16.1 Ajax Basics; 16.2 Supporting Ajax with Rails; 16.3 Managing Enrollment through Ajax; 16.4 Moving Further into Ajax; 16.5 Test Your Knowledge; Chapter 17: Mail in Rails; 17.1 Sending Text Mail; 17.2 Sending HTML Mail; 17.3 Sending Complex HTML Email; 17.4 Receiving Mail; 17.5 Test Your Knowledge; Chapter 18: Securing, Managing, and Deploying Your Rails Projects; 18.1 Securing Your Application; 18.2 Deploying Rails Applications; 18.3 Test Your Knowledge; Chapter 19: Making the Most of Rails--And Beyond; 19.1 Keep Up with Rails; 19.2 Plug-ins; 19.3 Ruby; 19.4 Web Services; 19.5 Explore Other Ruby Frameworks; 19.6 Migrating Legacy Applications to Rails; 19.7 Keep Exploring; An Incredibly Brief Introduction to Ruby; How Ruby Works; How Rails Works; Getting Started with Classes and Objects; Comments; Variables, Methods, and Attributes; Logic and Conditionals; An Incredibly Brief Introduction to Relational Databases; Tables of Data; Databases, Tables, and Rails; An Incredibly Brief Guide to Regular Expressions; What Regular Expressions Do; Starting Small; The Simplest Expressions: Literal Strings; Character Classes; Escaping; Modifiers; Anchors; Sequences, Repetition, Groups, and Choices; Greed; More; A Catalog of Helper Methods; Calling Helper Methods; ActiveRecordHelper; AssetTagHelper; AtomFeedHelper and AtomFeedHelper::AtomFeedBuilder; BenchmarkHelper, CacheHelper, and CaptureHelper; DateHelper; DebugHelper; FormHelper, FormTagHelper, and FormOptionsHelper; JavaScriptHelper; NumberHelper; PrototypeHelper; RecordIdentificationHelper; SanitizeHelper; ScriptaculousHelper; TagHelper; TextHelper; UrlHelper; Glossary; Speaking in Rails; Colophon;