Synopses & Reviews
Learning Rails takes a web-centric approach to the popular web application framework, making it easier to get started. Most Rails books are written for programmers who have already worked in other frameworks. They explain how to handle the inner parts of an application first -- models and controllers -- before moving on to the view. For web developers who know HTML and JavaScript, though, starting with databases is a painful way to learn Rails. This book approaches Rails from the outer layer, letting web designers create something visible before reaching the difficult database models and controller code in the inner layers. With Learning Rails, you can start from the HTML and programming you already know, and then move more deeply into Ruby, objects, and database structures. Once the book gets you up and running, you'll learn how to: Present content by building a simple application with a basic view and a simple controller, while learning Ruby along the way Build forms and process their results, moving from the simple to the 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 scaffold to build applications from a view-centric perspective Manage content with Rails using features like routing and layouts Add common web applications elements like sessions, cookies, and authentication Build applications that combine data in multiple tables Test data structures and deploy them to a production environment Create dynamic interfaces with Rails and Ajax
By the end of the book, you'll be comfortable working in Rails. You won't be a Ruby guru, but you'll be ready to take advantage of other resources forbecoming one. This approach may test the patience of hardcore programmers. But, while databases and objects may be at the core of web application development, they aren't necessarily at the core of everyone's web application skills. If you'd rather learn Rails from the outside in, working with the more familiar view side of the application, you're in the right place with Learning Rails.
Synopsis
This unique book gives web designers with little programming experience a gentle way to learn the Rails development framework. Most books about the Ruby on Rails web development framework are written for programmers, with emphasis on the difficult inner part of an application first. It makes sense, but for web developers and designers, who know HTML and maybe PHP or JavaScript, it's a painful way to learn Rails. This book deals with Rails from the outside in, letting web designers create something visible before reaching the inner details of database models and controller code.
Synopsis
This unique book deals with Rails from the outside in, providing relevant information for experienced Web developers and designers who have an interest in using Rails.
Synopsis
While most books written about Rails cater to programmers looking for information on data structures, Learning Rails targets web developers whose programming experience is tied directly to the Web.
Rather than begin with the inner layers of a Rails web application--the models and controllers--this unique book approaches Rails development from the outer layer: the application interface. You'll learn how to create something visible with Rails before reaching the more difficult database models and controller code. With Learning Rails, you can start from the foundations of web design you already know, and then move more deeply into Ruby, objects, and database structures. This book will help you:
- Present web 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 the simple to the more complex
- Connect forms to models by setting up a database, and use Rails' ActiveRecord 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
Once you complete Learning Rails, you'll be comfortable working with the Rails web framework, and you'll be well on your way to becoming a Rails guru.
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 in the Online Cloud: Heroku; 1.2 Getting Started with Instant Rails; 1.3 Getting Started at the Command Line; 1.4 What Server Is That?; 1.5 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;