ruby

Jobalytics – a Passenger on Dreamhost

After Ninh pointed out Dreamhost’s mod_rails news, I was tempted to get my hands dirty deploying a test application. I revivied one of my long lost pets (that hated the FCGI it was running on), made some modifications, and capified it to my Dreamhost’s account. And … It was a breeze. The deployment process (including capistrano script modifications, and...

Passenger (mod_rails) on Dreamhost

I got an update from Ninh Bui from Passenger fame about Dreamhost progress on mod_rails adoption. We’re working closely with Dallas Kashuba (CTO of Dreamhost) on getting Passenger ‘dreamhost’ ready (even though we’ve inferred it was already production ready, taking on a huge hosting company is a challenge on its own, i.e. it’s in its own league 🙂 ).We’re...

Rails deployment that suits Rails development

The guys from Phusion – The Computer Science Company – released mod_rails (Passenger) today. I’m just feeling unusually happy. They made a great job not only producing that longly-awaited piece of software (years in the waiting), but also creating a great hype, marketing, documenting, testing, and nailing down the details that made Rails deployment as easy and as enjoyable...

Rails vs The 7 Frameworks

This has nothing to do with comparing 8 different frameworks. It’s just to tell the horror story of one of our down-the-drain projects. The client came with an old product that he needed to add new features to. The product does, what is best described as CRUD operations. Nothing challenging, nothing difficult. It maintains a set of data for...

Rocket Science

Obie Fernandez, the author of the now de facto Rails book, The Rails Way, have recently launched HashRocket, a Ruby on Rails consultancy with a unique business model: Your application in 3 days or your money back OK! That money-back part is of my imagination. The reason I’m writing this is the “great” message on their homepage. BUILDING A...

On-Ruby Contest Winner

Pat Eyler from On Ruby has notified me that I won his Holiday Blogging Contest. My entry for generating a Rails site map was apparently the best Rails how-to in those posted. It won me 3 books from Apress.This is my first online win EVER, and being it a Rails-oriented win, makes it even sweeter. Thanks Pat. Thanks Apress.

Rails Sitemap

“When something is too hard, it means that you’re not cheating enough. it means that you’re doing it wrong“. Generating a Rails sitemap (hash of application controllers and actions) is as simple as placing and calling this method in your application: 1234567891011121314 def controllers_and_actions require ‘find’ site_map = {} Find.find(RAILS_ROOT + ‘/app/controllers’) do |file_name| if /_controller.rb$/ =~ file_name name...

Rails – multi selects for associated models

Handling Multiple Selects (or multiple associated attributes) can be quite cumbersome. Ryan Bates has recently wrapped it very nicely in his Complex Forms Screencast. As per that simple way, here’s a how I handle it: Model: 1234567891011class Project < ActiveRecord::Base….has_many :assigned_taskshas_many :users, :through => :assigned_tasks….def assigned_task_attributes=(assigned_attributes)assigned_attributes.each do |attributes|assigned_tasks.build(attributes)endendend Controller:def create @project_task = ProjectTask.new(params[:project_task]) @project_task.save New/Edit Views:<%= select_tag(“project[assigned_task_attributes][][user_id]”, options_for_select(@users.collect{|u| [u.full_name,...

Blueprint-CSS

After using the CSS Framework from Content-with-style for a few years, I grew tired of how it’s structured, and how difficult it is to customize. Along came Blueprint-CSS. A great concept, and wonderful implementation. And with the new BlueprintCSS Generator plugin for Rails from Ariejan.net, how can I resist using it. I’m rolling it out in my current project...