View gist:ada1bfc873eed6db6efd
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to match all subfolders:
// 'test/spec/**/*.js'
module.exports = function (grunt) {
// load all grunt tasks
View gist:61e2d213d148c3814a42
haml: {
files: ['<%= yeoman.app %>/{layout,snippets,templates,templates/customers}/*.haml'],
tasks: ['haml']
},
update: {
files: ['<%= yeoman.app %>/{layout,snippets,templates,templates/customers}/*.liquid'],
tasks: ['copy']
},
View gist:7269928
$('#Helium').on('ready', function(e){
console.log('ready');
$('#Helium').on('add-to-cart', function(e, sku){
console.log('added '+ sku + ' to cart');
_gaq.push(["_trackEvent", "Helium Cart", "Add To Cart", "Peruvian Strap", "Dick Dale"]);
});
});
View gist:5629182
FactoryGirl.define do
factory :user do
sequence(:email) { |n| "person_#{n}@example.com"}
password "secret"
password_confirmation "secret"
factory :admin do
after(:create) {|user| user.add_role(:admin)}
end
end
View gist:5629126
it "is non nil" do
user = FactoryGirl.create(:user)
user.email != nil
end
View gist:5627723
validates :password, :presence => { :on => :create },
:confirmation => true,
length:{ in: 6..40 }, if: ->{ crypted_password.blank? }
View gist:5627636
class User < ActiveRecord::Base
rolify
authenticates_with_sorcery!
attr_accessible :email, :password, :password_confirmation
email_regex = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :email, :presence => true,
:format => { :with => email_regex },
View gist:5565070
Installing activesupport (4.0.0.beta1)
Gem::InstallError: activesupport requires Ruby version >= 1.9.3.
An error occurred while installing activesupport (4.0.0.beta1), and Bundler
cannot continue.
Make sure that `gem install activesupport -v '4.0.0.beta1'` succeeds before
bundling.
!
! Failed to install gems via Bundler.
!
! Heroku push rejected, failed to compile Ruby/rails app
View gist:5025944
def filename
"#{@original_filename}".underscore
end
View gist:5025765
class SongsController < ApplicationController
# GET /songs
def index
@songs = Song.all
@uploader = Song.new.track
@uploader.success_action_redirect = new_song_url
end
# GET /songs/1
def show