Skip to content

Instantly share code, notes, and snippets.

@jezdez
jezdez / postgres-memory
Created June 14, 2011 10:26
A script to start a Homebrew postgres in memory (needs lunchy to automatically stop the global postgres instance, gem install lunchy)
#!/bin/bash
# get lunchy: gem install lunchy
lunchy stop postgres
# Run this script to enable the Ramdisk for Postgres
VolumeName="postgres-memory"
# Size in MB, make sure is not too low or not too high
SizeInMB=2048
class CategoriesController < ApplicationController
before_filter :require_admin
before_filter :get_category, :only => [:show,:edit,:update,:destroy]
respond_to :html, :xml, :json
responders :flash, :http_cache, :collections
def index
respond_with( @categories = Category.query(params) )
end