Articles tagged 'rails'

Web Servers and Application Servers

A reader recently asked me why Ruby web app deploys usually have a web server (NGinX, Apache) and an application server (Unicorn, Thin, Puma, Racer, Mongrel, Passenger, Jakarta, TorqueBox or whatever I’ve forgotten this week).

Actually, he asked, “why do I need to run NGinX and Unicorn?” It’s a fair...

Understanding the Structure of Rails

Ruby on Rails is divided into several separate pieces. If you know what they are and what they do, you can use them individually. You can also look up documentation more easily, and you’ll know where to look for source code to a particular method, and which of several similarly-named methods does...

Rack and Session Store

A fellow asked me how he could store information per-user in Rack. This was my (brief) response:

Generally with the cookies object. Specifically, Rack has a “session”, which encodes a session identity into the cookies object, usually with some or all of your data.

You can also map from the session...

No More Requires

I hate all the “requires” at the front of Ruby files. I know what methods I’m using, but I have to write it in both places. Not exactly DRY. Rails skips them — you just use the classes you want. How can I automatically load my files like Rails does? Read on.

Ruby has methodmissing. When you call...

What is Rack?: A Primer

If you do Ruby web programming, you’ll often hear about “Rack.” You might hear about it from a Ruby dev you respect, and that you won’t get better at Ruby web stuff until you know what’s underneath.

Or you might have to write a to use Heroku and you’re thinking, “what’s”. It...

Starting Rails programming

I tutored Rails at CMU West for a bit. They asked me for recommendations for what the students should be doing to prepare for Rails programming.

You know, that’s advice I can share with anybody. Here’s what I wrote:

Sure, I can help a bit with this.

Michael Hartl has an excellent free tutorial...

Subscribe to get free ebook chapters and an emailed coding class now, plus videos and articles a few times a month.

Why this specific newsletter? You want to be an expert. Expertise comes from learning the fundamentals, deeply. And that comes from the best kind of practice. I write with that in mind. I won't waste your time.

(Yes, I also sell things. They're good, but I'm fine if you don't buy them.)