Posts tagged "rails"

Subdomains and sessions to the rescue!

We have been working on an application that allows administrators to create accounts for their users. Each account will be accessible under a subdomain, so we needed to setup a subdomain environment inside our application, and also in our development machine. In addition, we must be able to let the users signed in among several … »

Understanding Devise roles

After Devise was released, there were some misunderstandings about Devise roles and how to use it. And the best way to understand it is explaining which problem we wanted to solve when we designing Devise. In most applications developed at Plataforma, we usually have two actors: one which represents the client who hired us and … »

Devise: authentication for lazy programmers

It has been a couple weeks since we first bloged about Devise. At that time, we released version 0.1 and now, after some great feedback, some enhancements and a few bugs fixes, we reached Devise 0.4. So, what changed since then? I’m lazy, you’re lazy Devise now comes with generators, so adding up authentication to … »

Devise: flexible authentication solution for Rails

UPDATE: This post was an introduction to Devise and a couple of things changed since then. There is a more recent post which describes the same steps as below using generators and, for a more complete and always updated explanation, please check the README. In Rails Summit Latin America 2009, we showed Devise in a … »

Exporting data to CSV and Excel in your Rails apps

Sometimes users want to slice and dice data as they wish. In such scenarios, it’s usual to export the data in a tabular format so your users can use any spreadsheet editor and do whatever they want. Usually, we do that using CSV, right? OpenOffice and other editors can open CSV files flawlessly. Just double-click … »

How to avoid the dog-pile effect on your Rails app

Everyone already heard about scalability at least once. Everyone already heard about memcached as well. What not everyone might heard is the dog-pile effect and how to avoid it. But before we start, let’s take a look on how to use Rails with memcached. Rails + Memcached = expires_at && !exist?(“lock_#{key}”) orig_write(“lock_#{key}”, true, :expires_in => … »