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
<%= form_for(@client) do |f| %> | |
<% if @client.errors.any? %> | |
<div id="error_explanation"> | |
<h2><%= pluralize(@client.errors.count, "error") %> prohibited this client from being saved:</h2> | |
<ul> | |
<% @client.errors.full_messages.each do |msg| %> | |
<li><%= msg %></li> | |
<% end %> | |
</ul> |
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
# single tag | |
find recipe | |
1 chicken alfredo | |
2 chicken pot pie | |
3 meatloaf | |
4 pasta primavera | |
5 spaghetti | |
# recipe AND chicken | |
find recipe chicken |
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
FactoryGirl.define do | |
factory :employee do | |
# Your callback can be either for :build or :create, whichever | |
# makes the most sense for your situation. | |
after(:build) { |instance| instance.skills << create_list(:skill, 5) } | |
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
source 'https://rubygems.org' | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails', '4.0.1' | |
# Use postgresql as the database for Active Record | |
gem 'pg' | |
gem 'perpetuity', git: 'git://github.com/jgaskins/perpetuity.git', ref: '82cad54d7226ad17ce25d74c751faf8f2c2c4eb2' | |
gem 'perpetuity-postgres', git: 'git://github.com/jgaskins/perpetuity-postgres.git', ref: 'c167d338edc05da582ff3856e86f7fb7693df0bb' |
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
class Appointment < ActiveRecord::Base | |
include ActionView::Helpers::NumberHelper | |
default_scope :order => "start_time asc" | |
scope :in_date_range, lambda { |start_date, end_date| self.in_date_range(start_date, end_date) } | |
scope :for_day, lambda { |date| in_date_range(date, date) } | |
scope :for_today, lambda { for_day(Time.zone.today) } | |
scope :for_tomorrow, lambda { for_day(Time.zone.today + 1.day) } | |
scope :not_time_blocks, joins(:time_block_type).where("code = 'APPOINTMENT'") | |
scope :checked_out, joins(:payments) |
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
this.lunchHub = angular.module('lunchHub', []); | |
this.lunchHub.config([ | |
'$routeProvider', function($routeProvider) { | |
return $routeProvider.when('/addresses', { | |
templateUrl: '../templates/addresses/index.html', | |
controller: 'AddressIndexCtrl' | |
}).when('/groups', { | |
templateUrl: '../templates/groups/index.html', |
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
gulp.task('start-server', function() { | |
return server.listen(3000); | |
}); | |
gulp.task('jasmine', function() { | |
return gulp.src('spec/test.js') | |
.pipe(jasmine()); | |
}); | |
gulp.task('test', ['start-server', 'jasmine'], function() { |
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
gulp.task('test', function() { | |
server.listen(3000); | |
return gulp.src('spec/test.js') | |
.pipe(jasmine()) | |
.on('end', function () { | |
server.close(); | |
exit(); | |
}); | |
}); |
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
# Generated on 2014-11-05 using generator-angular 0.9.8 | |
'use strict' | |
# # Globbing | |
# for performance reasons we're only matching one level down: | |
# 'test/spec/{,*/}*.js' | |
# use this if you want to recursively match all subfolders: | |
# 'test/spec/**/*.js' | |
module.exports = (grunt) -> | |
# Load grunt tasks automatically |
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
# Generated on 2014-11-05 using generator-angular 0.9.8 | |
'use strict' | |
# # Globbing | |
# for performance reasons we're only matching one level down: | |
# 'test/spec/{,*/}*.js' | |
# use this if you want to recursively match all subfolders: | |
# 'test/spec/**/*.js' | |
module.exports = (grunt) -> | |
# Load grunt tasks automatically |
OlderNewer