Book Image

From PHP to Ruby on Rails

By : Bernard Pineda
4 (1)
Book Image

From PHP to Ruby on Rails

4 (1)
By: Bernard Pineda

Overview of this book

Are you a PHP developer looking to take your first steps into the world of Ruby development? From PHP to Ruby on Rails will help you leverage your existing knowledge to gain expertise in Ruby on Rails. With a focus on bridging the gap between PHP and Ruby, this guide will help you develop the Ruby mindset, set up your local environment, grasp the syntax, master scripting, explore popular Ruby frameworks, and find out about libraries and gems. This book offers a unique take on Ruby from the perspective of a seasoned PHP developer who initially refused to learn other technologies, but never looked back after taking the leap. As such, it teaches with a language-agnostic approach that will help you feel at home in any programming language without learning everything from scratch. This approach will help you avoid common mistakes such as writing Ruby as if it were PHP and increase your understanding of the programming ecosystem as a whole. By the end of this book, you'll have gained a solid understanding of Ruby, its ecosystem, and how it compares to PHP, enabling you to build robust and scalable applications using Ruby on Rails.
Table of Contents (15 chapters)
1
Part 1:From PHP to Ruby Basics
8
Part 2:Ruby and the Web

What this book covers

Chapter 1, Understanding the Ruby Mindset and Culture, provides an introduction to the way Ruby developers think and write code.

Chapter 2, Setting Up Our Local Environment, provides a short guide to installing Ruby to allow you to follow along with the exercises in this book.

Chapter 3, Comparing Basic Ruby Syntax to PHP, provides a comparison between PHP and Ruby syntax as a way to ease your entry into the language, its similarities, and its differences.

Chapter 4, Ruby Scripting versus PHP Scripting, compares PHP scripts with Ruby scripts with the intent of taking advantage of Ruby’s syntax to write more readable code.

Chapter 5, Libraries and Class Syntax, provides an introduction to Ruby’s libraries (gems) and their installation and usage. This chapter also provides an introduction to object-oriented programming in the Ruby realm.

Chapter 6, Debugging Ruby, provides an introduction to the tools we have available in Ruby to fix bugs and errors in scripts that we may encounter at runtime. This chapter also provides a guide to installing and using these tools.

Chapter 7, Understanding Convention over Configuration, provides an introduction to the Ruby on Rails web framework, its installation, and the simplest of examples to start using it.

Chapter 8, Models, DBs, and Active Record, provides an introduction to handling databases with Ruby on Rails through models. It also covers the basics of database actions using ActiveRecord.

Chapter 9, Bringing It All Together, provides a guide to generate a simple Ruby on Rails application using everything we’ve learned so far in the book, but via a more practical example.

Chapter 10, Considerations for Hosting Rails Applications versus PHP Applications, provides a short guide to the factors that you must take into account when publishing a Rails application in a real-life scenario, a.k.a. production.