Home » Rails » Page 4

Tag Archives: Rails

Learning Ruby on Rails with Nitrous.io

I’ve been programming a long time. I’ve written professional applications in Java, PHP, C#,ASP.NET, C++, and Silverlight. I’ve seen a lot of fads, and I’ve seen a lot of tools for programming come and go. My point is I think I know a pretty good thing when I see it, and Nitrous is definitely one of those things. I get ...

Read More »

Good Module, Bad Module

You already know how to use modules in Ruby, but are you abusing them? In this post, we’ll take a look at different ways to program with modules and why they may or may not be a great idea. Namespace Modules give you an easy way to namespace the rest of your code. For example, when you generate a new ...

Read More »

Level Up Your Security in Rails

I am not a security expert, and the truth is that most other developers aren’t either. I haven’t created my own hashing or encryption algorithm, I don’t know the inner workings of TLS, nor the different ciphers that are available, but that doesn’t give me a free pass when it comes to protecting my users and their data. One amazing ...

Read More »

Unobtrusive JavaScript via AJAX in Rails

For now, the main way to add dynamic content to a webpage is with JavaScript. Ideally, we want to update a site’s contents from the server without reloading the page. Let’s take a look at how we can accomplish this with AJAX in Rails. Now, many of the brief AJAX examples I’ve come across show variations of retrieving collections of data ...

Read More »

Counting Distinct Values With HyperLogLog

Counting distinct values is a trivial matter with small datasets, but it gets dramatically harder for streams with millions of distinct points. Absolute counting accuracy can be attained through a set, but then you have the undesirable tradeoff of linear memory growth. What you really want when dealing with enormous datasets is something with predictable storage and performance characteristics. That ...

Read More »

Producing Documentation for Your Rails API

Why is it such a joy to work with Stripe or Shopify as a developer? It could be for a number of reasons, but one of them is surely that they have great documentation. For these companies, documentation isn’t an afterthought — it’s something you can tell that they obviously spend a lot of time and resources on. Why is ...

Read More »

Surrogate WebSockets Alongside Rails

ActionCable is coming to Rails 5 and brings with it the promise of using WebSockets directly in Rails. Ruby has a notoriously bad concurrency story, and that certainly extends into the realm of WebSockets and pubsub. ActionCable may be suitable for a small number of authenticated sessions, but scaling persistent connections to thousands or tens-of-thousands won’t be easy. That’s all ...

Read More »

An Introduction to APIs with Phoenix

Phoenix is taking the internet by storm, with good reason. It’s productive, fault-tolerant, concurrent, safe as a compiled language, and blazing fast. It shares many of Rails’ core values, such as convention over configuration, restful resources, and a focus on developer happiness. The cherry on the top: Phoenix was designed from the ground up for WebSockets connections — so you ...

Read More »

Comparing Rails and Phoenix: Part II

In the first post of this two-part series, we touched on generating a new application and talked about the entry point to each application: the Router. We also discussed at a high level about how Phoenix apps can fit into larger OTP applications. In this post, we will be looking at the Model, View, and Controller, the parts that comprise ...

Read More »