Michael Hartl (2015) Ruby on Rails Tutorial, Third Edition, Addison Wesley
“Ruby on Rails™ Tutorial by Michael Hartl has become a must-read for developers learning how to build Rails apps.”
—Peter Cooper, Editor of Ruby Inside
Used by sites as diverse as Twitter, GitHub, Disney, and the Yellow Pages, Ruby on Rails is one of the most popular frameworks for developing web applications, but it can be challenging to learn and use. Whether you’re new to web development or new only to Rails, Ruby on Rails Tutorial, Third Edition, is the solution.
Best-selling author and leading Rails developer Michael Hartl teaches Rails by guiding you through the development of three example applications of increasing sophistication, focusing on the fundamental techniques in web development needed for virtually any kind of application. The updates to this edition include simplified installation via a standard development environment in the cloud, use of the default Rails stack throughout, a light-weight testing approach, an all-new section on image upload, and an all-new chapter on account activation and password resets, including sending email with Rails.
This indispensable guide provides integrated tutorials not only for Rails, but also for the essential Ruby, HTML, CSS, and SQL skills you’ll need when developing web applications. Hartl explains how each new technique solves a real-world problem, and then he demonstrates it with bite-sized code that’s simple enough to understand, yet novel enough to be useful. Whatever your previous web development experience, this book will guide you to true Rails mastery.
This book will help you
- Install and set up your Rails development environment, including a pre-installed integrated development environment (IDE) in the cloud
- Go beyond generated code to truly understand how to build Rails applications from scratch
- Learn testing and test-driven development (TDD)
- Effectively use the Model-View-Controller (MVC) pattern
- Structure applications using the REST architecture
- Build static pages and transform them into dynamic ones
- Master the Ruby programming skills all Rails developers need
- Create high-quality site layouts and data models
- Implement registration and authentication systems, including validation and secure passwords
- Update, display, and delete users
- Upload images in production using a cloud storage service
- Implement account activation and password reset, including sending email with Rails
- Add social features and microblogging, including an introduction to Ajax
- Record version changes with Git and create a secure remote repository at Bitbucket
- Deploy your applications early and often with Heroku
Table of Contents
Chapter 1: From Zero to Deploy
1.1 Introduction
1.2 Up and Running
1.3 Version Control with Git
1.4 Deploying
1.5 Conclusion
Chapter 2: A Demo App
2.1 Planning the Application
2.2 The Users Resource
2.3 The Microposts Resource
2.4 Conclusion
Chapter 3: Mostly Static Pages
3.1 Static Pages
3.2 Our First Tests
3.3 Slightly Dynamic Pages
3.4 Conclusion
3.5 Exercises
3.6 Advanced Setup
Chapter 4: Rails-Flavored Ruby
4.1 Motivation
4.2 Strings and Methods
4.3 Other Data Structures
4.4 Ruby Classes
4.5 Conclusion
4.6 Exercises
Chapter 5: Filling in the Layout
5.1 Adding Some Structure
5.2 Sass and the Asset Pipeline
5.3 Layout Links
5.4 User Signup: A First Step
5.5 Conclusion
5.6 Exercises
Chapter 6: Modeling Users
6.1 User Model
6.2 User Validations
6.3 Adding a Secure Password
6.4 Conclusion
6.5 Exercises
Chapter 7: Sign Up
7.1 Showing Users
7.2 Signup Form
7.3 Signup Failure
7.4 Signup Success
7.5 Conclusion
7.6 Exercises
Chapter 8: Sign In, Sign Out
8.1 Sessions and Signin Failure
8.2 Signin Success
8.3 Introduction to Cucumber (Optional)
8.4 Conclusion
8.5 Exercises
Chapter 9: Updating, Showing, and Deleting Users
9.1 Updating Users
9.2 Authorization
9.3 Showing All Users
9.4 Deleting Users
9.5 Conclusion
9.6 Exercises
Chapter 10: User Microposts
10.1 A Micropost Model
10.2 Showing Microposts
10.3 Manipulating Microposts
10.4 Conclusion
10.5 Exercises
Chapter 11: Following Users
11.1 The Relationship Model
11.2 A Web Interface for Following Users
11.3 The Status Feed
11.4 Conclusion
11.5 Exercises
Download Ruby on Rails 3 Tutorial – Learn Rails by Example (2011) (PDF 9,196KB)
Online: The Ruby on Rails Tutorial (Third Edition) – Learn Web Development with Rails by Michael Hartl
(https://www.railstutorial.org/book)
An intermediate level tutorial that is highly recommended throughout the Rails community. Extremely well written, technically sound, comprehensive and up-to-date.
The Ruby on Rails Tutorial book and screencast series teach you how to develop and deploy real, industrial-strength web applications with Ruby on Rails, the open-source web framework that powers top websites such as Twitter, Hulu, GitHub, and the Yellow Pages. The Ruby on Rails Tutorial book is available for free online and is available for purchase as an ebook (PDF, EPUB, and MOBI formats). The companion screencast series includes 12 individual lessons, one for each chapter of the Ruby on Rails Tutorial book. All purchases also include a free copy of the Solutions Manual for Exercises, with solutions to every exercise in the book.
Table of Contents
- Chapter 1 From zero to deploy
- Chapter 2 A toy app
- Chapter 3 Mostly static pages
- Chapter 4 Rails-flavored Ruby
- Chapter 5 Filling in the layout
- Chapter 6 Modeling users
- Chapter 7 Sign up
- Chapter 8 Log in, log out
- Chapter 9 Updating, showing, and deleting users
- Chapter 10 Account activation and password reset
- Chapter 11 User microposts
- Chapter 12 Following users
Lenz, P. (2008) Simply Rails 2 – The Ultimate Beginner’s Guide to Ruby, Second Edition, SitePoint
Download eBook PDF (PDF 14,028KB)
Download Source Code (ZIP 542KB)
With Simply Rails 2 you’ll learn how to build bulletproof Web applications from scratch, with more features using less code.
Patrick’s updated the entire book to take advantage of all the new Rails 2 features. It’s the only beginner’s book we know that’s Rails 2 ready…
Inside the book you’ll learn how to:
– Build and deploy your own Rails web application.
– Reap the benefits of using best-practice MVC architecture.
– Use Rails’s Ajax features to create slick interfaces.
– Interact with databases easily using ActiveRecord.
– Add the magic of REST to your apps with Rails Resources.
– Use plugins to enhance your applications easily.
Simply Rails 2 will show you that there is a simple and easy way to build web 2.0 applications.
Simply Rails 2 is an easy-to-follow, practical and fun guide to Ruby on Rails for beginners. It covers all you need to get up and running, from installing Ruby, Rails and SQLite to building and deploying a fully featured web application.
Unlike other Rails books, this book doesn’t assume that you are an experienced web developer, or that you’ve used Ruby before. An entire chapter is devoted to learning Ruby in a fun way, using the interactive Ruby console, so you can follow along at home. You’ll be an accomplished Ruby programmer in no time!
This book focuses on the practical parts of Rails that you can use to build next-generation web applications, rather than the obscure features of Rails that no one uses.
The book uses Rails 2 — the (then) very latest version of Rails — so you can take advantage of all of the latest features of the framework.
Packed with easy-to-understand instructions and sample code, Simply Rails 2 is the ultimate beginner’s guide to Ruby on Rails.
Want to learn all about Ruby on Rails 2.0, the web application framework that is inspiring developers around the world?
The second edition of this practical, hands on book will:
- show you how to install Ruby on Rails on Windows, Mac, or Linux
- walk you, step by step, through the development of a Web 2.0 social news application, just like digg.com
- show you how to test, debug, benchmark, and deploy your Rails application
Unlike other Rails books, this book doesn’t assume that you are an experienced web developer, or that you’ve used Ruby before. An entire chapter is devoted to learning Ruby in a fun way, using the interactive Ruby console, so you can follow along at home. You’ll be an accomplished Ruby programmer in no time!The example application that the book builds – a user-generated news web site – is built upon with each following chapter, and concepts such as sessions, cookies and basic AJAX usage are gradually introduced. Different aspects of Rails, such as user authentication, session cookies, and automated testing are explored with each feature that is added to the application.
The book finishes with chapters on debugging, benchmarking and deployment to a live web server.
By the end of the book, you’ll have built a fully-featured Web 2.0 application and deployed it to the Web. And all code is up-to-date for Rails 2.0, so you can begin coding immediately with the latest version of Rails.
What Will You Learn?
This book will teach you how to:
- Program with confidence in the Ruby language.
- Build and deploy a complete Rails web application.
- Exploit the new features available in Rails 2.
- Use Rails’ Ajax features to create slick interfaces.
- Reap the benefits of a best-practice MVC architecture.
- Work with databases easily using ActiveRecord.
- Implement RESTful development patterns and clean URLs.
- Create a user authentication system.
- Use object oriented concepts like inheritance and polymorphism.
- Build a comprehensive automated testing suite for your application.
- Add plugins to easily enhance your application’s functionality.
- Use migrations to manage your database schema without data loss.
- Achieve maximum code reuse with filters and helper functions.
- Debug your application using the ruby_debug client.
- Analyze your application’s performance using the Rails logging infrastructure.
- Benchmark your application to determine performance bottlenecks.
- And a whole lot more
What you’ll learn
- How to interact with your database using ActiveRecord and migrations instead of arcane SQL commands
- Adding Ajax and visual effects to your application, using the built-in Prototype and script.aculo.us JavaScript libraries
- Understand and use a model-view-controller architecture, maximizing code reuse and simplifying code maintenance.
Learn Ruby on Rails – A Tutorial by Daniel Kehoe (2013)
(http://learn-rails.com/learn-ruby-on-rails.html)
Get a solid start on Ruby on Rails web development with this book by renowned teacher and author Daniel Kehoe.
The book that is called “The best Rails book for beginners.”
Download Learn Ruby on Rails – A Tutorial by Daniel Kehoe (PDF 1,729KB)
For a solid start on Ruby on Rails web development…
Learn in a weekend
Build a real-life web application, using the newest Rails 4.2 version.
- Install Rails
- Mac, Linux, or Windows
- Recommended gems
- Front-end frameworks
- Troubleshooting techniques
- Where to get help
- Rails challenges
Master the basics
No other tutorial does a better job of explaining basic concepts.
- Ruby language literacy
- Rails directory structure
- Request-response cycle
- Model-view-controller architecture
- Static and dynamic pages
- Forms processing
- Testing
Work professionally
Learn the practices you’ll use in the workplace.
- Ruby Version Management
- Workflow with Git
- Environment variables
- Security practices
- Product planning
- Project management
- Analytics
Prepare to go further
Learn Ruby on Rails is the best way to get the most from advanced tutorials and courses, preparing you for:
- Capstone Rails Tutorials
- Dev Bootcamp & other code camps
- Michael Hartl’s Ruby on Rails Tutorial
Get this book by renowned teacher and author Daniel Kehoe. No other tutorial does a better job of explaining the concepts. Master the basics. Learn the practices you’ll use in the workplace as a professional Rails developer. Learn in a weekend, building a real-life web application, using the newest Rails version.
Is It For You?
This book is written for YOU if you are new to Ruby on Rails and…
- You’ve got experience with the web and need to learn Rails
- You don’t know how to program — but want to learn
- You want to build an application
- You want to start a career as a professional web developer
What Experts Are Saying
Linda Liukas, co-founder of Rails Girls…
“Learn Ruby on Rails is a great book for anyone starting to learn web development, giving you the context and explanations at the right time in an encouraging way.”
Michael Hartl, author of the Ruby on Rails Tutorial…
“If you’re new to web development, I recommend Daniel Kehoe’s excellent Learn Ruby on Rails book. Learn Ruby on Rails is the gentlest introduction to Rails that I know of, so it’s a great place for beginners to start.”
Chapters and Topics
- Introduction – What You’ll Learn
- Concepts – How the Web Works, What is Rails?, Gems, Git, Testing, Rails Stacks
- Get Help When You Need It – Stack Overflow, Meetups, Pair Programming, Code Reviews
- Plan Your Product – User Stories, Wireframes and Mockups, Behavior-Driven Development
- Manage Your Project – Kanban, Trello, Agile
- Accounts You May Need – GitHub, Gmail, MailChimp, Heroku
- Get Started – Text Editor, Terminal, Unix commands, Installing Ruby
- Create the Application – Starter Applications, Rails New, Server, Log Messages
- The Parking Structure – Rails Files and Folders Explained
- Time Travel with Git – Configuring Git, Repository, GitIgnore, Git Workflow, GitHub
- Gems – Where Do Gems Live?, Gemfile, Bundler
- Configure – Environment Variables, Config Secrets File, Configure Email
- Static Pages and Routing – Public Folder, Home Page, About Page, Routes
- Request and Response – Browser Developer Tools View, Document Object Model, Model View Controller
- Dynamic Home Page – Naming Conventions, Routing, Model, View, Controller
- Troubleshoot – Interactive Ruby Shell, Rails Console, Logger, Stack Trace, Exceptions
- Just Enough Ruby – Ruby Literacy, Object-Oriented Terminology, Ruby Basics
- Layout and Views – Template Languages, ERB, Application Layout, Boilerplate, Yield, View Helpers
- Front-End Framework – Asset Pipeline, Navigation, Partials, Messages, Zurb Foundation
- Add Pages – High Voltage Gem, Contact Page
- Contact Form – SimpleForm, Params Hash, Validation, ActiveModel, RESTful Controllers, Security
- Spreadsheet Connection – APIs, Connecting to Google Drive, Service-Oriented Architecture
- Send Mail – Mailer, Queueing and Background Jobs
- Mailing List – APIs
- Deploy – Heroku
- Analytics – Google Analytics, Segment, Turbolinks, Page and Event Tracking
- Testing – Why Test?, What Are Tests?, Minitest, Capybara, Feature Tests, TDD
- Rails Composer – Starter Applications
- Rails Challenges – Overcoming Obstacles
- Crossing the Chasm – Building Your Own Applications, Finding a Mentor, Self-Help Strategies
- Level Up – What to Learn Next
Hawthorne, Andy (2015) JumpStart Rails, SitePoint
Download JumpStart Rails (PDF 4,266KB)
Download Code Archive (ZIP KB)
Get up to speed with Ruby on Rails 4 in a weekend.
n just a few short years, Ruby on Rails has grown from cool, hipster upstart to global powerhouse. Developers around the world are passionate about Rails, and with good reason.
BUILD FAST with 60,000+ ready-to-go Ruby gems, powerful, new functionality is a never more than a few keystrokes away.
DISCOVER Test-driven development for better programming practices.
SCALE APPS Look at GitHub, Twitter, Hulu, and Penny Arcade. All huge. All successful. All Rails.
GET HIRED Search any job board, there’s massive demand for Rails developers.
Those who have jumped onboard the Ruby on Rails train have never looked back and neither will you.
Learn Rails and you’ll write better code, faster, spend less time setting up and maintaining code and more time building.
Consider this book an investment in your career. There’s a huge and growing demand for developers with Rails skills, just look at any job board.
Learn Rails this weekend.
What will I learn?
Embrace good coding practice by learning the Rails way:
- Convention over configuration
- The Model–View–Controller (MVC) architecture
- Test-driven development (TDD)
- Don’t repeat yourself (DRY)
Make web development a much slicker process with Rails. It’s built on the Ruby programming language, which is a delight to work with too.
Who should read this book?
This book is for programmers new to Ruby and new to Rails.
Back-end developers experienced on other programming languages such as PHP will be able to get up to speed with Rails’ fundamentals in a weekend.
It is assumed that you know your way about the command line, and some programming fundamentals.
Shaw, Z. A. and Sobers, R. (2012) Learn Ruby the Hard Way – A Simple and Idiomatic Introduction to the Imaginative World of Computational Thinking with Code, Second Edition
The free HTML version of the book is available at http://learnrubythehardway.org/book/
The Third Edition is now available…..
Do you really want to learn programming but have no skill? Are you a system administrator who wants to learn Puppet or Chef? Are you a designer who wants to build your own websites? Are you a Ruby on Rails programmer who’s ashamed that you don’t really know Ruby? Then you should read this book. It assumes absolutely no prior programming knowledge and will guide you carefully and slowly through the learning process.
Learn Ruby The Hard Way is a retelling of the original “Learn Python The Hard Way” teaching Ruby, with all new simple yet idiomatic Ruby code written by Zed A. Shaw. “Learn Python The Hard Way” has taught hundreds of thousands worldwide how to code in Python, and this book uses the same proven method for Ruby. When you are done with this book you will have the skill to move on to other books about Ruby and be ready to understand them.
Download Learn Ruby the Hard Way (PDF 449KB)
Welcome to Learn Ruby the Hard Way, 3rd Edition. You can visit the companion site to the book at http://learnrubythehardway.org/ where you can purchase digital downloads and paper versions of the book. The free HTML version of the book is available at http://learnrubythehardway.org/book/
Table Of Contents
- Preface
- Introduction: The Hard Way Is Easier
- Exercise 0: The Setup
- Exercise 1: A Good First Program
- Exercise 2: Comments And Pound Characters
- Exercise 3: Numbers And Math
- Exercise 4: Variables And Names
- Exercise 5: More Variables And Printing
- Exercise 6: Strings And Text
- Exercise 7: More Printing
- Exercise 8: Printing, Printing
- Exercise 9: Printing, Printing, Printing
- Exercise 10: What Was That?
- Exercise 11: Asking Questions
- Exercise 12: Prompting People
- Exercise 13: Parameters, Unpacking, Variables
- Exercise 14: Prompting And Passing
- Exercise 15: Reading Files
- Exercise 16: Reading And Writing Files
- Exercise 17: More Files
- Exercise 18: Names, Variables, Code, Functions
- Exercise 19: Functions And Variables
- Exercise 20: Functions And Files
- Exercise 21: Functions Can Return Something
- Exercise 22: What Do You Know So Far?
- Exercise 23: Read Some Code
- Exercise 24: More Practice
- Exercise 25: Even More Practice
- Exercise 26: Congratulations, Take A Test!
- Exercise 27: Memorizing Logic
- Exercise 28: Boolean Practice
- Exercise 29: What If
- Exercise 30: Else And If
- Exercise 31: Making Decisions
- Exercise 32: Loops And Arrays
- Exercise 33: While Loops
- Exercise 34: Accessing Elements Of Arrays
- Exercise 35: Branches and Functions
- Exercise 36: Designing and Debugging
- Exercise 37: Symbol Review
- Exercise 38: Doing Things To Arrays
- Exercise 39: Dictionaries, Oh Lovely Dictionaries
- Exercise 40: Modules, Classes, And Objects
- Exercise 41: Learning To Speak Object Oriented
- Exercise 42: Is-A, Has-A, Objects, and Classes
- Exercise 43: Gothons From Planet Percal #25
- Exercise 44: Inheritance Vs. Composition
- Exercise 45: You Make A Game
- Exercise 46: A Project Skeleton
- Exercise 47: Automated Testing
- Exercise 48: Advanced User Input
- Exercise 49: Making Sentences
- Exercise 50: Your First Website
- Exercise 51: Getting Input From A Browser
- Exercise 52: The Start Of Your Web Game
- Advice From An Old Programmer
- Next Steps
- Appendix A: Command Line Crash Course
Pine, Chris (2009) Learn to Program (Facets of Ruby), Pragmatic Bookshelf
Computers are everywhere, on every desk, in your iPod, cell phone, and PDA. To live well in the 21st century, you need to know how to make computers do things. And to really make computers do what you want, you have to learn to program.
Fortunately, that’s easier now than ever before. Chris Pine’s book will teach you how to program. You’ll learn to use your computer better, to get it to do what you want it to do. Starting with small, simple one-line programs to calculate your age in seconds, you’ll see how to advance to fully structured, real programs. You’ll learn the same technology used to drive modern dynamic websites and large, professional applications.
It’s now easier to learn to write your own computer software than it has ever been before. Now everyone can learn to write programs for themselves—-no previous experience is necessary. Chris takes a thorough, but light-hearted approach that teaches you how to program with a minimum of fuss or bother.
For this new edition of the best-selling Learn to Program, Chris Pine has taken a good thing and made it even better. First, he used the feedback from hundreds of reader e-mails to update the content and make it even clearer. Second, he updated the examples in the book to use the latest stable version of Ruby, and also to use code that looks more like real-world Ruby code, so that people who have just learned to program will be more familiar with common Ruby techniques.
Not only does the Second Edition now include answers to all of the exercises, it includes them twice. First you’ll find the “how you could do it” answers, using the techniques you’ve learned up to that point in the book. Next you’ll see “how Chris Pine would do it”: answers using more advanced Ruby techniques, to whet your appetite as well as providing sort of a “Rosetta Stone” for more elegant solutions.
Cooper, Peter (2009) Beginning Ruby: From Novice to Professional (Expert’s Voice in Open Source), Second Edition, Apress
Based on the bestselling first edition, Beginning Ruby: From Novice to Professional, Second Edition is the leading guide for every type of reader who wants to learn Ruby from the ground up.
The new edition of this book provides the same excellent introduction to Ruby as the first edition plus updates for the newest version of Ruby, including the addition of the Sinatra and Ramaze web application frameworks and a chapter on GUI development so developers can take advantage of these new trends.
Beginning Ruby starts by explaining the principles behind object-oriented programming and within a few chapters builds toward creating a full Ruby application. By the end of the book, in addition to in-depth knowledge of Ruby, you’ll also have basic understanding of many ancillary technologies such as SQL, XML, web frameworks, and networking.
- Introduces readers to the Ruby programming language
- Takes readers from basic programming skills to web development with topics like Ruby-based frameworks and GUI programming
- Covers many ancillary technologies in order to provide a broader picture (e.g., databases, XML, network daemons)
What you’ll learn
- Understand the basics of Ruby and object-oriented building blocks.
- Work with Ruby libraries, gems, and documentation.
- Work with files and databases.
- Write and deploy Ruby applications.
- Explore Ruby web frameworks and aspects of network programming with Ruby.
- Develop desktop and GUI applications with Ruby.
Who this book is for
Beginning programmers, programmers new to Ruby, and web developers interested in knowing the foundations of the language.
Table of Contents
- Let’s Get It Started: Installing Ruby
- Programming = Joy: A Whistle-Stop Tour of Ruby and Object Orientation
- Ruby’s Building Blocks: Data, Expressions, and Flow Control
- Developing Your First Ruby Application
- The Ruby Ecosystem
- Classes, Objects, and Modules
- Projects and Libraries
- Documentation, Error Handling, Debugging, and Testing
- Files and Databases
- Deploying Ruby Applications and Libraries
- Advanced Ruby Features
- Tying It Together: Developing a Larger Ruby Application
- Web Application Frameworks: Rails, Sinatra, and Ramaze
- Ruby and the Internet
- Networking, Sockets, and Daemons
- GUI-Based Desktop Application Development
- Useful Ruby Libraries and Gems
Collingbourne, Huw (2008) The Little Book of Ruby, Second Edition, Dark Neon Ltd.
(http://www.sapphiresteel.com/ruby-programming/The-Little-Book-Of-Ruby.html)
Your FREE guide to Programming Ruby from SapphireSteel software (http://www.sapphiresteel.com)
The fastest, easiest way to learn Ruby ‘by example.
The Little Book Of Ruby is a PDF eBook which will guide you through the fundamentals of Ruby programming. Starting with the basics (strings, numbers, objects and methods) it quickly moves on to explain all you need to know to create your own class hierarchies, use arrays, hashes, iterators, modules, mixins and much more besides…
Download source code archive (ZIP 25KB)
OR direct from
http://www.sapphiresteel.com/ruby-programming/The-Little-Book-Of-Ruby.html
You can load these source files into any Ruby editor or IDE.
About the Book
Rails 4 in Action is a hands-on guide to the subject. In this fully revised new edition, you’ll master Rails 4 by developing a ticket-tracking application that includes RESTful routing, authentication and authorization, file uploads, email, and more. Learn to design your own APIs and successfully deploy a production-quality application. You’ll see test-driven development and behavior-driven development in action throughout the book, just like in a top Rails shop.
Ruby on Rails is an open source web framework. It’s famously simple to build a basic Rails application. Once you’ve started down the track, however, you discover that Rails is a powerful, deep, and rich full-stack platform capable of tackling virtually any development challenge.
Rails 4 in Action is a fully-revised second edition of Rails 3 in Action. This hands-on, comprehensive introduction to Rails gives readers everything they need to become competent and confident Rails developers. It shows how to develop a ticket tracking application that includes RESTful routing, authentication and authorization, file uploads, email, and more. It explores powerful features like designing APIs and building a Rails engine. The book also provides Test Driven Development and Behavior Driven Development in action throughout the book—just like in a top Rails shop.
Rails is a full-stack, open source web framework powered by Ruby. Now in version 4, Rails is mature and powerful, and to use it effectively you need more than a few Google searches. You’ll find no substitute for the guru’s-eye-view of design, testing, deployment, and other real-world concerns that this book provides.
What’s Inside
- Creating your own APIs
- Using RSpec and Capybara
- Emphasis on test-first development
- Fully updated for Rails 4
About the reader
For readers of this book, a background in Ruby is helpful but not required. No Rails experience is assumed.
Table of Contents
- Ruby on Rails, the framework
- Testing saves your bacon
- Developing a real Rails application
- Oh, CRUD!
- Nested resources
- Authentication
- Basic access control
- Fine-grained access control
- File uploading
- Tracking state
- Tagging
- Sending email
- Deployment
- Designing an API
- Rack-based applications
1.1. Ruby on Rails overview
1.1.1. Benefits
1.1.2. Ruby gems
1.1.3. Common terms
1.1.4. Rails in the wild
1.2. Developing your first application
1.2.1. Installing Rails
1.2.2. Generating an application
1.2.3. Starting the application
1.2.4. Scaffolding
1.2.5. Migrations
1.2.6. Viewing and creating purchases
1.2.7. Validations
1.2.8. Routing
1.2.9. Updating
1.2.10. Deleting
1.3. Summar
2. Testing saves your bacon
2.1. Using TDD and BDD to save your bacon
2.2. Test-driven development basics
2.2.1. Writing your first test
2.2.2. Saving bacon
2.3. Behavior-driven development basics
2.3.1. Introducing RSpec
2.3.2. Writing your first spec
2.3.3. Running the spec
2.3.4. Much more bacon
2.3.5. Expiring bacon
2.4. Summary
3. Developing a real Rails application
3.1. First steps
3.1.1. The application story
3.1.2. Laying the foundations
3.2. Version control
3.2.1. Getting started with GitHub
3.2.2. Configuring your Git client
3.3. Application configuration
3.3.1. The Gemfile and generators
3.3.2. Database configurations
3.4. Beginning your first feature
3.4.1. Creating projects
3.4.2. Defining a controller action
3.4.3. RESTful routing
3.4.4. Committing changes
3.4.5. Setting a page title
3.4.6. Validations
3.5. Summary
4. Oh CRUD!
4.1. Viewing projects
4.1.1. Introducing Factory Girl
4.1.2. Adding a link to a project
4.2. Editing projects
4.2.1. The edit action
4.2.2. The update action
4.3. Deleting projects
4.4. What happens when things can’t be found
4.4.1. Visualizing the error
4.4.2. Handling the ActiveRecord::RecordNotFound exception
4.5. Styling the application
4.5.1. Installing Bootstrap
4.5.2. Improving the page’s header
4.5.3. Improving the show view
4.5.4. Semantic styling
4.5.5. Using Simple Form
4.5.6. Adding a navigation bar
4.5.7. Responsive styling
4.6. Summary
5. Nested resources
5.1. Creating tickets
5.1.1. Nested routing helpers
5.1.2. Creating a tickets controller
5.1.3. Demystifying the new action
5.1.4. Defining a has_many association
5.1.5. Creating tickets in a project
5.1.6. Finding tickets scoped by project
5.1.7. Ticket validations
5.2. Viewing tickets
5.2.1. Listing tickets
5.2.2. Culling tickets
5.3. Editing tickets
5.3.1. The ticket-editing spec
5.3.2. Adding the edit action
5.3.3. Adding the update action
5.4. Deleting tickets
5.5. Summary
6.1. Using Devise
6.2. Adding sign-up
6.3. Adding sign-in and sign-out
6.3.1. Adding sign-in
6.3.2. Adding sign-out
6.3.3. Styling the Devise views
6.4. Linking tickets to users
6.4.1. Fixing the failing four features
6.5. Summary
7. Basic access control
7.1. Turning users into admins
7.1.1. Adding the admin field to the users table