As a Rails developer, you care about user experience and performance, but you also want simple and maintainable code. Achieve all that by embracing the full stack of web development, from styling with Twitter Bootstrap, building an interactive user interface with AngularJS, to storing data quickly and reliably in PostgreSQL. Take a holistic view of full-stack development to create usable, high-performing applications, and learn to use these technologies effectively in a Ruby on Rails environment.
Buy Now
This title is currently available in Beta. Buy the eBook now, and you'll be able to download successive releases of the eBook as the authors add material and correct mistakes. You'll get the final eBook when the book is finished.
You'll also be able to buy the paper book at a substantial discount when it's released (we're currently estimating 2015-10-10, but these dates can change).
About this Book
- 240 pages (est)
- Published:
- Release: B1.0 (2015-07-28)
- ISBN: 978-1-68050-126-1
Rails is a great tool for building web applications, but it’s not the best at everything. Embrace the features built into your database. Learn how to use front-end frameworks. Seize the power of the application stack through AngularJS, Bootstrap, and PostgreSQL. When used together, these powerful and easy-to-use tools will open you to a new world of possibilities. In each chapter of this book, you’ll learn how these technologies can work together inside a Rails app to deliver well-performing applications that offer great user experiences.
Create a usable and attractive login form using Bootstrap’s styles, while ensuring the database table backing it is secure, using Postgres’ check constraints. You’ll see how creating an advanced Postgres index for a case-insensitive search can speed up your back-end—allowing you to create a highly dynamic user experience using AngularJS. You’ll create reusable components that bring Bootstrap and Angular together, effectively use materialized views for caching within Postgres, and store unstructured data in an indexed JSON field. You’ll get your front-end working with the Asset Pipeline, use Postgres’ features from migrations, and write unit tests for all of it. All of this within Rails.
You’ll gain the confidence to work at every level of the application stack, bringing the right solution to every problem.
What You Need
You’ll need the latest version of Ruby on Rails and have some experience with basic Rails concepts. You’ll learn how to install Postgres on your computer or use a free version of it in the cloud. You should have a cursory understanding of JavaScript, CSS, and SQL, but by no means need to be an expert. You should install Postgres 9.4, Rails 4.2, and Ruby 2.2.
Contents and Extracts
This book is currently in beta, so the contents and extracts will change as the book is developed.
- Introduction
- The Application Stack
- PostgreSQL, Angular, and Bootstrap: The Missing Parts of Our Stack
- Learning Postgres, Angular, and Bootstrap At The Same Time
- Getting Set Up
- Create a Great-Looking Login with Bootstrap and Devise
- Setting up Devise for Authentication
- Installing Bootstrap with Bower
- Styling The Login and Registration Forms
- Validating Registration
- Next Up: Using Postgres to Make our Login More Secure
- Secure the Login Database with Postgres Constraints
- Exposing The Vulnerability Devise and Rails Leaves Open
- Prevent Bad Data Using Check Constraints
- Why Use Rails Validations?
- Next Up: Using Postgres Indexes to Speed Up a Fuzzy Search
- Use Fast Queries with Advanced Postgres Indexes
- Implementing a Basic Fuzzy Search with Rails
- Understanding Query Performance With the Query Plan
- Indexing Derived and Partial Values
- Next Up: Better-looking Results with Bootstrap’s List Group
- Create Clean Search Results with Bootstrap Components
- Creating Google-style Search Results without Tables
- Paginating the Results using Bootstrap’s Components
- Next Up: Angular!
- Build a Dynamic UI with AngularJS
- Configuring Rails and Angular
- Porting our Search to Angular
- Changing our Search to Use Typeahead
- Next Up: Testing
- Test This Fancy New Code
- Installing RSpec for Testing
- Testing Database Constraints
- Running Headless Acceptance Tests in PhantomJS
- Writing Unit Tests for Angular Components
- Next Up: Level Up On Everything
- Create a Single-Page App Using Angular’s Router
- Using Angular’s Router for User Navigation
- Serving Angular Templates from the Asset Pipeline
- Adding a Second View and Controller to our Angular App
- Next Up: Design Using Grids
- Design Great UIs With Bootstrap’s Grid and Components
- Cache Complex Queries Using Materialized Views
- Load Data from Many Sources Asynchronously
- Save Changes to the Server Automatically When it Changes
- Build Your Own Angular/Bootstrap Components
- Grab Bag: More Useful Tidbits