This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'rails', '3.2.0' | |
gem 'mysql2' | |
# Using this branch of ActiveAdmin to allow batch editing of records. | |
#gem 'activeadmin', :git => 'https://github.com/mattvague/active_admin.git', :branch => '270_batch_edit_api' | |
gem 'activeadmin', '0.4.0' | |
gem 'sass-rails', '3.2.4' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= semantic_form_for @parent do |a| %> | |
<%= a.inputs "Family Details" do %> | |
<%= a.input :name %> | |
<%= a.input :user %> | |
<%= a.input :region %> | |
<% end %> | |
<%= a.inputs "Children" do %> | |
<table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rakefile inspired by http://rhnh.net/2010/09/07/speeding-up-rails-rake | |
def load_rails_environment | |
require File.expand_path('../config/application', __FILE__) | |
require 'rake' | |
TimeAudit::Application.load_tasks | |
end | |
# By default, do not load the Rails environment. This allows for faster | |
# loading of all the rake files, so that getting the task list, or kicking | |
# off a spec run (which loads the environment by itself anyways) is much quicker. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone --mirror https://github.com/Daxter/active_admin.git acitve_admin/.git | |
cd active_admin | |
git config --bool core.bare false # it's initially a bare repo, so we've got to fix that | |
git checkout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module YourApplication | |
class Application < Rails::Application | |
# Loads ruby files in a given directory. | |
# NOTE: `require_dependency` auto-reloads on file change when in development. | |
# POSTERITY: this was needed to prevent auto-namespacing of lib/a/b.rb files. | |
def loader(*dirs) | |
dirs.each do |dir| | |
Dir["#{Rails.root}/#{dir}/*.rb"].each do |path| | |
d = dir.gsub /lib\/?/, '' # removes lib and lib/ | |
require_dependency (d.blank? ? '' : d + '/') + File.basename(path, '.rb') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ -> | |
confirmBox = (message, inputs, callback) -> | |
html = """<div id="dialog_confirm" title="Confirmation"><p>#{message}</p>""" + | |
inputs.map((a)-> """<label>#{a}</label><input name="#{a}"></input>""").join("\n") + | |
"</div>" | |
$(html).appendTo('body').dialog | |
modal: true | |
buttons: | |
OK: -> | |
callback $(@).find('input').serializeArray() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define a setter to pass in a custom log formatter | |
class ActiveSupport::BufferedLogger | |
def formatter=(formatter) | |
@log.formatter = formatter | |
end | |
end | |
# Defines a custom log format (time, severity, message, PID, backtrace)... all with color! | |
class Formatter | |
SEVERITY_TO_TAG = {'DEBUG'=>'meh', 'INFO'=>'fyi', 'WARN'=>'hmm', 'ERROR'=>'wtf', 'FATAL'=>'omg', 'UNKNOWN'=>'???'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# At the beginning of each web request, log the current number of symbols in memory. | |
class ApplicationController < ActionController::Base | |
protect_from_forgery | |
@@sym_count_logger = Logger.new('log/sym_count.log') | |
before_filter do | |
@@sym_count_logger.info Symbol.all_symbols.count | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Failures: | |
1) ActiveAdmin::Namespace registering a page adding to the menu disabling the menu should not create a menu item | |
Failure/Error: expect { | |
expected KeyError, got #<IndexError: key not found> | |
# /home/sean/.rvm/gems/ruby-1.8.7-p371@active_admin/gems/rspec-expectations-2.9.1/lib/rspec/expectations/fail_with.rb:33:in `fail_with' | |
# /home/sean/.rvm/gems/ruby-1.8.7-p371@active_admin/gems/rspec-expectations-2.9.1/lib/rspec/expectations/handler.rb:19:in `handle_matcher' | |
# /home/sean/.rvm/gems/ruby-1.8.7-p371@active_admin/gems/rspec-expectations-2.9.1/lib/rspec/expectations/extensions/kernel.rb:12:in `to' | |
# /home/sean/code/gems/active_admin/spec/unit/namespace/register_page_spec.rb:70 | |
# /home/sean/.rvm/gems/ruby-1.8.7-p371@active_admin/gems/rspec-core-2.9.0/lib/rspec/core/example.rb:80:in `instance_eval' |
OlderNewer