Skip to content

Instantly share code, notes, and snippets.

View lorenjohnson's full-sized avatar

Loren Johnson lorenjohnson

View GitHub Profile
source :gemcutter
gem 'rails', '3.0.12'
gem 'mysql2', '< 0.3'
gem 'unicorn'
gem 'jquery-rails', '>= 0.2.7'
gem 'jrails'
shared: &shared
adapter: mysql2
encoding: utf8
reconnect: false
pool: 5
socket: /tmp/mysql.sock
username: root
password:
development:
@lorenjohnson
lorenjohnson / setup_controller.rb
Created August 26, 2011 07:06
Meta Programming all the SetupControllers
class SetupController < ApplicationController
before_filter :set_instance_and_user, :object, :objects
respond_to :html, :js
def index
flash[:warning] = flash[:notice] = nil if !params[:cancel].blank?
eval("@#{controller.controller_name.singularize} = #{controller.controller_name}")
instance_variable_set("@#{object_name}", model_klass.new(params[object_name]))
instance_variable_set("@#{objects_name}", model_klass.order("updated_on DESC"))
respond_with(eval("@#{objects_name}"))
@lorenjohnson
lorenjohnson / gist:793353
Created January 24, 2011 15:16
Errors on Deploy
MacBookPros-MacBook-Pro:goodgift loren$ git push heroku master
Counting objects: 589, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (288/288), done.
Writing objects: 100% (589/589), 228.89 KiB, done.
Total 589 (delta 280), reused 502 (delta 250)
-----> Heroku receiving push
-----> Rails app detected
-----> Detected Rails is not set to serve static_assets