More and more Rails developers are switching to Phoenix

Phoenix is a rising star in the world of web development. Built by a former Rails developer, Phoenix takes everything that makes Rails great and improves on it, letting you build feature-rich, maintainable apps at lightning speed.

Phoenix uses Elixir, a functional programming language that runs on the Erlang VM. Erlang is well-known for its scalability, performance and fault-tolerance. Elixir takes the power of Erlang and wraps it a beautiful, elegant, Ruby-like syntax.

The design of Elixir and Phoenix takes heavy inspiration from Ruby and Rails, and both are growing rapidly in popularity among Rails developers. Many Rails devs before you have made the switch and not looked back.

Learning a new framework can be frustrating

When you’re comfortable developing in Rails, it’s painful to start from scratch with something new. Many of Phoenix’s concepts, like “controllers” and the “router”, feel obvious to a Rails developer, but others are harder to understand, such as Phoenix’s approach to data validation, which works very differently to Rails’s ActiveRecord validators. It’s frustrating to get stuck not knowing how to build something when you know how you’d do the same thing in Rails.

Luckily, there’s a better way to learn.

Take a shortcut using your existing knowledge

Learning Phoenix when you already know Rails is like learning Spanish when you already speak Italian. Your existing knowledge gives you a big head-start, and you’d be foolish not to make the most of it.

Most Phoenix tutorials ignore this, and take a generic approach that assumes you’re starting from zero. Phoenix on Rails is different – it explains everything you need to know in an intuitive manner that makes maximum sense to a Ruby on Rails developer. It’ll teach you where

Phoenix on Rails will teach you Elixir and Phoenix in a manner that’s intuitive to a Ruby on Rails developer. It’ll help you relate the various concepts of Elixir and Phoenix to the things you already know, and understand where they’re similar to Ruby on Rails and where they’re different.

Course content

Phoenix on Rails contains 51 written lessons, divided into four parts.

By the end of the tutorial you’ll have built a fully-featured Phoenix web app. You’ll be introduced to all of Phoenix’s major concepts, and you’ll know how to accomplish all the things that you already know how to do in Rails.

Part 1

In Part 1, you’ll learn how to program in Elixir.

First comes a basic introduction to Elixir syntax. As you’ll see, it looks a lot like Ruby, but the similarities can be deceptive. Then you’ll learn about Elixir’s various functions, modules, and data structures.

Some Elixir concepts are easy for a Rubyist to understand. For example, Elixir “atoms” are basically the same as Ruby “symbols”. Others, however, are less familiar, such as the distinction between Elixir “lists” and “tuples”, which has no direct analogy in Ruby. Phoenix on Rails explains everything in terms that maximum sense to a Ruby programmer.

In Part 2, you’ll scaffold a simple Rails app, with a model, controller and views – then you’ll throw it away and learn how to build the same app in Phoenix.

Some are familiar from Rails, like routers, controllers, and migrations, although they still work slightly differently from what you’re used to. Others are quite different – for example, Phoenix has no “models”, and Phoenix “views” work very differently to Rails views.

By the end of part 2 you’ll have a high-level understanding of how the different parts of Phoenix fit together.

Part 2

Part 3

In Part 3, you’ll add more features to the simple app you built in part 2. This is an opportunity to learn about some more advanced concepts, like Phoenix scaffolding, using Erlang libraries in Elixir, Phoenix’s “Plug” library (similar to Rails’s “Rack”), and dependency management with Mix (similar to Bundler and the Gemfile in Rails).

Part 3 also introduces Phoenix LiveView. You’ll use LiveView to add a dynamic frontend to your Phoenix app without any need for Javascript.

In Part 4 you’ll build a app from scratch that’s more advanced than the toy app you built in parts 2 and 3.

Along the way you’ll learn how to do even more with Phoenix, including a complete and secure authentication system (with no need a for third-party package like Rails’s Devise), file uploads, advanced features of Phoenix LiveView, and more

By the end of part 4 you’ve have built a fully-featured web app. You’ll be familiar with all the important concepts in Phoenix and Elixir.

Part 4

Questions

Who is this course for?

Phoenix on Rails is aimed at developers who already have at least one year’s experience programming in Ruby on Rails. If you don’t know Ruby or Rails, you might still get some value from this course, but it’s not guaranteed.

What’s the stack?

The current version of the tutorial uses Elixir 1.13, Phoenix 1.6, and LiveView 0.18. Phoenix on Rails will be kept up to date with all major future updates to Phoenix at no extra cost to you.

Do I need to know Elixir?

Phoenix on Rails assumes no prior knowledge of Elixir. It teaches you all the Elixir you need to build a fully-featured Phoenix app.

If you already have some familiarity with Elixir, you might still learn something from the Elixir section of the tutorial, as it will help you understand how Elixir’s concepts relate to the Ruby concepts you already know.

Does it cover LiveView?

Yes, Phoenix on Rails includes an introduction to LiveView. Both applications you build will use LiveView to dynamically render part of their frontends.

What about Javascript and CSS?

Phoenix, like Rails, is a server-side technology. Phoenix on Rails covers the basics of managing a Phoenix app’s frontend assets including Javascript and CSS files, but it doesn’t explain how to a build a single-page application or a highly dynamic frontend using modern Javascript frameworks like React or Vue.js.

However, one of the many things developers love about Phoenix is that you don’t need Javascript to create a dynamic frontend. With Phoenix LiveView you can add interactive behaviour to your app’s frontend using Elixir alone, without the need to write any custom Javascript. Phoenix on Rails will teach you how this is done.

Can I try it risk-free?

Absolutely. Sign up, and if you’re not 100% satisfied, send us an email within 30 days of purchasing and you’ll receive a full refund.

I have another question

No problem! Get in touch on contact@phoenixonrails.com

.

Read More