Skip to content

Instantly share code, notes, and snippets.

- model_class = Account
.page-header
%h1=t '.title', :default => model_class.model_name.human.pluralize
%table.table.table-striped
%thead
%tr
%th= model_class.human_attribute_name(:name)
%th= model_class.human_attribute_name(:subdomain)
%th= model_class.human_attribute_name(:owner)
%th= model_class.human_attribute_name(:notes)
@alanowens
alanowens / ApplicationController.rb
Created September 17, 2012 19:19
How to turn this into routes.rb entries
def subdomain_junk
if request.subdomain == 'signup'
unless ((request.path == new_user_registration_path) || (request.path == '/accounts/check_exists') || (request.path == '/users'))
redirect_to new_user_registration_path
end
elsif request.path == new_user_registration_path
unless ((request.subdomain == 'signup') || (request.path == '/accounts/check_exists'))
if request.port == 80
redir_url = request.protocol + 'signup' + '.' + request.domain + new_user_registration_path
else
@alanowens
alanowens / Gemfile
Created October 8, 2012 13:37
Delayed_paperclip error
source 'https://rubygems.org'
gem 'rails', '3.2.8'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
#gem 'haml-rails'
gem 'sass'