The Rails View: Creating a Beautiful and Maintainable User Experience

The Rails View: Creating a Beautiful and Maintainable User Experience

The Rails View: Creating a Beautiful and Maintainable User Experience

The Rails View: Creating a Beautiful and Maintainable User Experience

Paperback

$35.00 
  • SHIP THIS ITEM
    Qualifies for Free Shipping
    Choose Expedited Shipping at checkout for delivery by Wednesday, April 3
  • PICK UP IN STORE
    Check Availability at Nearby Stores

Related collections and offers


Overview

Working in the View layer requires a breadth of knowledge and attention to detail unlike anywhere else in Rails. One wrong move can result in brittle, complex views that stop future development in its tracks. This book will help you break free from tangles of logic and markup in your views as you pick up the practical skills you need to implement your user interface cleanly and maintainably.

You'll discover how to build up solid, sustainable layouts and popular interface elements with semantic HTML5 and CSS3, and when you can responsibly generate markup and use advanced presenters... all without leaving the designers on your team out in the cold. Widen your appeal with responsive design, and discover how new progressive enhancement techniques can take you beyond the "weakest link" approach of the past. Master the asset pipeline introduced in Rails 3.1 and use Sass and Coffeescript to make your interface code shorter and more enjoyable.

You'll create elegant, well-structured views that are a joy to build on. You'll appreciate its comprehensive, objective guidance in a realm full of subjective opinions.

What You Need:

All examples in the book assume Rails 3.1 or later and Ruby 1.9.x are installed. Detailed information on how to install these for Windows, Mac OS X and Linux is included in the book.


Product Details

ISBN-13: 9781934356876
Publisher: Pragmatic Programmers, LLC, The
Publication date: 04/03/2012
Pages: 264
Product dimensions: 7.58(w) x 8.80(h) x 0.82(d)

About the Author

Bruce Williams is a longtime speaker, trainer, designer, and book contributor in the Ruby and Rails community and has experience in everything from low-level data processing backends to front-end user interaction. He is a Senior Developer in R&D at LivingSocial.

John Athayde is a UI/UX/Design type who comes from an architecture (of the building variety) background. He's been in the Rails community since 2006 and has broad experience in e-commerce and running creative teams. He is currently a Senior UI/UX Designer at LivingSocial.

Table of Contents

Acknowledgments ix

Preface xi

1 Creating an Application Layout 1

1.1 Creating a Basic Layout 2

1.2 Setting Up a Boilerplate 6

1.3 Building the Page Frame 14

1.4 Adding a Sidebar 23

1.5 Adding Navigation 28

1.6 Displaying Notifications 36

1.7 Validating Our Code 39

1.8 Testing Internet Explorer 41

1.9 Wrapping Up 47

2 Improving Readability 49

2.1 Choosing a Templating Language 49

2.2 Standardizing Coding Practices 51

2.3 Simplifying Complex Output 56

2.4 Working with Models 63

2.5 Displaying Conditional Content 65

2.6 Adding Model DOM IDs for JavaScript 69

2.7 Cleaning Up 71

2.8 Wrapping Up 72

3 Adding Cascading Style Sheets 73

3.1 Using the Asset Pipeline 73

3.2 Learning SCSS 76

3.3 Adding Sprites 88

3.4 Using Web Fonts 92

3.5 Wrapping Up 98

4 Adding JavaScript 101

4.1 Using JavaScript from Rails 101

4.2 Testing Ajax 110

4.3 Wrapping Up 117

5 Building Maintainable Forms 119

5.1 Using Semantic Form Tags 119

5.2 Building Custom Form Builders 132

5.3 Looking Toward the Future of HTML5 Form Elements 140

5.4 Wrapping Up 142

6 Using Presenters 143

6.1 Presenting a Record 144

6.2 Presenting Multiple Records 153

6.3 Using Presenters for Serialization 158

6.4 Wrapping Up 161

7 Handling Mobile Views 163

7.1 Building a Flexible Layout 164

7.2 The Next Level with Responsive Design (�media queries) 168

7.3 Using Mobile-Specific Templates 174

7.4 Using jQuery Mobile 179

7.5 Wrapping Up 188

8 Working with Email 189

8.1 Building a Mailer 189

8.2 Handling Email Templates 191

8.3 Testing Locally 195

8.4 Testing Across Clients 196

8.5 Wrapping Up 206

9 Optimizing Performance 207

9.1 A/B Testing with Vanity 207

9.2 Performance Testing and Maintenance 214

9.3 Wrapping Up 228

9.4 Where Do We Go from Here? 229

A1 The Rails View Rules 233

A2 Bibliography 235

Index 237

From the B&N Reads Blog

Customer Reviews