Think In Geek

In geek we trust

ruby on rails

How to create and configure EC2 instances for Rails hosting with CentOS using Ansible

Introduction In this quite extensive post I will walk you through the process of creating from scratch a box in EC2 ready to use for deploying your Rails app using Ansible. In the process I will show how to write a simple module that, while not necessary, will illustrate some points as well. Keep in […]

, , , , , , , , , , ,

Create a temporary zip file to send as response in Rails

We have been doing a painful migration from Rails 2 to Rails 3 for several months at work, and refactoring some code the other day I had to do something in a non straightforward way, so I thought I’d share that. Basically we had an action that would group several files into a zip file […]

, ,

acts_as_list gem and single table inheritance in Rails

If you ever need to use the acts_as_list gem in Rails on a model that uses single table inheritance, here’s the snippet you need to use for the list methods to work if you want the setup done on the base model: acts_as_list :scope => [:type]acts_as_list :scope => [:type] You’ll need to use the array […]

, ,

Capybara, pop up windows and the new PayPal sandbox

This past weeks we have been doing a massive refactoring of our testing suite at work to set up a nice CI server setup, proper factories, etc. Our tool-belt so far is basically a well known list of Rails gems: Factory Girl for factories. RSpec as a testing framework (although we’ll switch back to Test::Unit […]

, , ,

Ruby on Rails, Varnish and user dependent content

Ruby on Rails performance is a topic that has been widely discussed. Whichever the conclusion you want to make about all the resources out there, the chances you’ll be having to use a cache server in front of your application servers are pretty high. Varnish is a nice option when having to deal with this […]

, ,

Give your Ruby console a dash of colour

When you’re developing an application in Rails (or Ruby), you spend lots of time in the IRB, the Interactive Ruby Shell. Usually just to test some Ruby code, start an application console or debug something going on inside the project. Yesterday, looking at a coworker screen, I saw he had his console with lots of […]

, , ,

Fix Java GUI applications in xmonad

If you ever try to run a GUI Java application when using xmonad as the Window Manager, you’ll probably end up with a nice flat grey window where your buttons, toolbars and other desktop GUI goodies should be. I ran into that problem the other day when trying to evaluate the RubyMine Ruby on Rails […]

, , , , ,

Ruby on Rails Many To Many associations with multiple databases

Sometimes you need to use multiple databases in your Rails projects. Usually when some data must be shared between different applications. When this happens you usually have some models in a shared database, and some other models in the specific application database. This can be easily done using the establish_connection method in the shared models […]

, , , , ,

Creating your own Job Managers in Ubiquo

Ubiquo is a Ruby on Rails, MIT Licensed Open Source CMS we develop and use at gnuine for a variety of projects. One of the features of Ubiquo is the ability to run jobs separately from the http requests to the site. Today I’m going to show you how to customize the Ubiquo Jobs plugin […]

,

Iterate over a collection in groups, and other things

One thing I find fascinating about Ruby is the fact that most common tasks are already programmed for you in its library. The Enumerable module is a clear example of that, providing you with lots of functionality to manipulate collections of objects. One of those useful methods I discovered the other day was each_slice. This […]

, ,

Previous Posts