Beginning Rails 4, Third Edition

Book description

Beginning Rails 4 is a book that will guide you from never having programmed with Ruby, to having a Rails application built and deployed to the web. You'll learn how to combine all the components of Rails to develop your own web applications. You will use test driven development to make sure your application works exactly like you expect.

You will learn how to use Git for source control and best practice techniques to create applications like a pro. Essential, and often-missed, information on testing and learning to program with Ruby are also covered.

This book is well suited for someone with little to no Ruby or Rails experience, or possibly even someone with no experience developing web applications at all. Beginning Rails 4 does assume a basic familiarity with the web and typical web terms, but doesn't require you to be an expert of these. This book will springboard your journey into web application development, and show you how much fun building web applications with Ruby on Rails can be.

  • Learn to create Rails applications from the bottom up

  • Learn the basics of the Ruby programming language

  • Completely updated for Rails 4, including new information on turbo links, etc.

  • Beginning Rails 4 gently guides you through designing your application, writing tests for the application, and then writing the code to make your application work as expected.

    What you'll learn

  • Learn the basics of the Ruby programming language

  • Learn the components of Rails, and how to leverage them to build rich web applications

  • Build a good foundation so you can move on to more advanced techniques

  • Learn the basics of databases and how to use them to store and retrieve your data

  • Use git source control and contribute to open source on Github

  • Deploy your application to the web so others can use it

  • Who this book is for

    Beginning Rails 4 is for anyone who wants to learn to quickly build applications, and deploy them to the web. No matter your experience level you'll learn something from this book.

    Table of contents

    1. Title Page
    2. Dedication
    3. Contents at a Glance
    4. Contents
    5. About the Authors
    6. About the Technical Reviewer
    7. Introduction
    8. CHAPTER 1: Introducing the Rails Framework
      1. The Rise and Rise of the Web Application
      2. The Web Isn’t Perfect
      3. The Good Web Framework
      4. Enter Rails
      5. The MVC Pattern
      6. The Libraries That Make Up Rails
      7. Rails Is Modular
      8. Rails Is No Silver Bullet
      9. Summary
    9. CHAPTER 2: Getting Started
      1. An Overview of Rails Installation
      2. Installing on Mac OS X 10.8 Mountain Lion
      3. Installing on Windows
      4. Installing on Linux
      5. Creating Your First Rails Application
      6. Summary
    10. CHAPTER 3: Getting Something Running
      1. An Overview of the Project
      2. Creating the Blog Application
      3. Summary
    11. CHAPTER 4: Introduction to the Ruby Language
      1. Instant Interaction
      2. Ruby Data Types
      3. Language Basics
      4. Classes and Objects
      5. Ruby Documentation
      6. Summary
    12. CHAPTER 5: Working with a Database: Active Record
      1. Introducing Active Record: Object-Relational Mapping on Rails
      2. Introducing the Console
      3. Active Record Basics: CRUD
      4. When Good Models Go Bad
      5. Summary
    13. CHAPTER 6: Advanced Active Record: Enhancing Your Models
      1. Adding Methods
      2. Using Associations
      3. Advanced Finding
      4. Applying Validations
      5. Making Callbacks
      6. Reviewing the Updated Models
      7. Summary
    14. CHAPTER 7: Action Pack: Working with the View and the Controller
      1. Action Pack Components
      2. A Controller Walk-Through
      3. Summary
    15. CHAPTER 8: Advanced Action Pack
      1. Generating a Controller
      2. Nested Resources
      3. Sessions and the Login/Logout Logic
      4. Improving Controllers and Templates
      5. Adding Finishing Touches
      6. Summary
    16. CHAPTER 9: JavaScript and CSS
      1. Asset Concatenation and Compression
      2. Turbolinks
      3. Let’s Build Something!
      4. Summary
    17. CHAPTER 10: Sending and Receiving E-Mail
      1. Setting Up Action Mailer
      2. Sending E-Mail
      3. Receiving E-Mail
      4. Summary
    18. CHAPTER 11: Testing Your Application
      1. How Rails Handles Testing
      2. Unit Testing Your Rails Application
      3. Functional Testing Your Controllers
      4. Integration Testing
      5. Running the Full Test Suite
      6. Summary
    19. CHAPTER 12: Internationalization
      1. Internationalization Logic in Rails
      2. Setting Up i18n in the Blog Application
      3. Localizing the Blog Application to Brazilian Portuguese
      4. Bilingual Blog
      5. Summary
    20. CHAPTER 13: Deploying Your Rails Applications
      1. Set Up an Account with Heroku
      2. Preparing Your Git Repository
      3. That’s it!
      4. Summary
    21. APPENDIX A: Databases 101
      1. Examining a Database Table
      2. Working with Tables
      3. Understanding Relationships
      4. SQL and Active Record
    22. APPENDIX B: The Rails Community
      1. Beginning Rails 4 Channels
      2. Rails Mailing Lists
      3. Rails IRC Channel
      4. Rails Blogs and Podcasts
      5. Rails Guides
      6. Rails APIs
      7. Rails Source and Issue Tracking
    23. APPENDIX C: Git
      1. What Is Source Control Management?
      2. How Does It Work?
      3. Git
      4. Other SCM Systems
      5. Online Resources
    24. Index

    Product information

    • Title: Beginning Rails 4, Third Edition
    • Author(s): Adam Gamble, Cloves Carneiro Jr., Rida Al Barazi
    • Release date: September 2013
    • Publisher(s): Apress
    • ISBN: 9781430260349