Rails: Serving a Site With Apache Under OS X

Almost all the Rails documentation assumes that you’ll be serving your app up using either WEBrick or lighttpd, neither of which are suitable for me since I use Apache for both development and on the live servers.
Unfortunatelly finding Apache info can be difficult so to that end, here’s what I’ve done to get my Rails […]

Rails: Some New User Advice

It’s been about a month into learning Ruby and Rails now I’ve stumbled across a number of things I think might be good advice for other beginners. In the intrists of altruism, here they are:

Create a Hello World app first, without worrying about doing anything with the database
After the Hello World is done and before […]

Rails: Creating Database Migrations

Part of the sweet tool suite in Rails is ActiveRecord’s Migration, a database-agnostic mechanism for defining the application’s database structure as well as any changes that need to be made to the database over the life of the project.
The Rails wiki entry for Using Migrations.
The supported datatypes for database columns (note that these don’t map […]

Fog Creek’s Copilot Now Mac-compatible

Joel Spolsky notes today that Copilot 2.0 has shipped and it now has supports Macs.
As someone who tends to do a lot of computer tech support for a number of people, both Mac and Windows (somehow the Linux folks seem to make it through on their own… without the occassional sound driver or running in […]

Rails: Getting Routed

Jamis Buck, one of the core developers of Ruby on Rails, writes an indispensable Rails blog with the unweildy name of the { buckblogs :here }. I’ve been reading it daily, learning something new about Rails each day. Today’s post, Named, explicit routes is all about routing paths in Rails, something up until now I […]

Rails: Updating the core

Ruby on Rails 1.2 was recently released (up to 1.2.1 as most stable now) and it turns out that updating to 1.2.1 under OS X is as simple as:

$ sudo gem update rails

XHTML Autocomplete in TextMate

A handy (perhaps vital?) tip for working with XHTML documents in TextMate. In order to get XHTML self-closing tags to work (ie: <image /> or <br />) in documents with an XHTML doctype, do this:

1. Go to Preferences -> Advanced -> Shell Variables
2. Create a new variable, named TM_XHTML with the value ‘ /’ (no […]

I Think I See Some Mac Love

Mike got a new Mac and it looks like he’s discovering the funner bits and pieces.
It brings a tear to my eye

Rails: Cancel Buttons and Forms

The Rails framework provides a great wealth of helper functions for creating forms via the FormHelper, FormTagHelper and FormOptionsHelper classes but one item conspicuously missing for some reason is a Cancel button.
Creating one is pretty straighforward, however. Lets say there's a form in place for creating new User groups:
PLAIN TEXT
RUBY:

<%= form_tag :action => 'create' %>

<%= [...]

Rails: Knowing the current Action in a View

At some point you, like me, may want to do something in a Rails view that is dependent upon the current action. But how to know what the currect action is (without doing some ugly URL parsing)?
The Highlight link for current action over on Code Snippets has the solution.
Add the following to your application.rb controller:
PLAIN [...]

keep looking »