Ruby

A Designer that LOVES Rails??? Really?

Yep.

Don't ruin your cutting-edge rails application with an unoriginal, unprofessional or unusable design. We eat, sleep and breath the web language standards, and we know what it takes to make your application look as good in the browser as it does in TextMate.

When you hire New Media Logic to design your application's look, you'll spend no time getting us up to speed on the Rails architecture or on your application's design. We know the Rails conventions. We've built rails applications ourselves and we know the idioms. We know Ruby

Ruby or PHP strftime Without Leading Zeros

The docs for strftime() in both PHP and Ruby seem to assume that you prefer your dates and times to be formatted with leading zeros padding the output to 2 characters. For the minutes, this seems logical enough (4:05 instead of 4:5), but for the hours field it can be a little unattractive (04:05). Here are the format strings you can use for non-zero padded versions of the fields:

%l: The hour in 12-hour format, without a leading zero
%e: The day of the month, without a leading zero

Overriding Default Getters in ActiveRecord

I find somewhat frequent occasions where dynamic Model getters are handy. The most common case is where you want to use the value of one attribute unless it's nil, in which case you want to use another attribute instead. You could do @object.field1 || @object.field2, but that's not very DRY if you do it often.

Instead, you can override the default attribute accessor that ActiveRecord builds for you with code like the following:

Ruby Installation on FERRARI

At the time of this post, Ruby on Rails required version 1.8.2 of Ruby, which is not the most current version. Installation of a Ruby on Rails development system is easiest if you download dependencies from the left column of the RubyOnRails download page.

First, download Ruby 1.8.2-15 (stable). Install without SciTE and FreeRIDE. Installation directory c:\ruby\1.8.2-15.

Second, download RubyGems (most current version). Unzip the distribution and run ruby on setup.rb. This will install the gems libraries as well as the gem command.

Third, install rails.

Rails Won't Run With Ruby 1.8.3

Ruby on Rails fails to run with Ruby 1.8.3 The error is:

$ rails
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/clean_logger.rb:13:in `remove_const': constant Logger::Format not defined (Na
meError)
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support/clean_logger.rb:13
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/active_support.rb:31
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require'

Rails and FastCGI Setup on Fedora+

http://wiki.rubyonrails.com/rails/pages/RailsOnFedora

Ruby (on Rails) Installation on Windows

Most of the material in this tutorial comes from two places: How to Install Ruby on Windows, and Windows Success Stories in Rails.

Ruby installation is extremely simple on Windows, thanks to the Nullsoft installer. The installer copies the Ruby binaries to a path of your choice and adds the bin directory to your PATH.

  1. Download the Ruby Installer.