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
gem('rspec-rails', group: 'test') | |
gem('debugger', group: 'development') | |
gem('jquery-rails', group: 'development') | |
gem('backbone-on-rails', group: 'development') | |
gem('backbone-support', group: 'development') | |
gem('activeadmin') | |
gem('faraday') | |
gem('mechanize') |
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
App.assets = { | |
// Returns an object containing all of asset pipeline's image paths. | |
// | |
// Sample: | |
// | |
// { | |
// avatars/missing_avatar.png: "/assets/avatars/missing_avatar.png" | |
// chosen-sprite.png: "/assets/chosen-sprite.png" | |
// circle_green.png: "/assets/circle_green.png" | |
// circle_orange.png: "/assets/circle_orange.png" |
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
Type | Count | Total | |
---|---|---|---|
A | 604 | 300.864 | |
OP | 438 | 223.673 | |
IAP | 448 | 229.404 | |
AAP | 366 | 207.206 | |
PP | 0 | 0.000 | |
BP | 27 | 0.760 | |
PP | 565 | 298.920 | |
AMP | 12 | 1.184 |
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
date | wounds | other | disease | |
---|---|---|---|---|
5/1854 | 0 | 95 | 105 | |
6/1854 | 0 | 40 | 95 | |
7/1854 | 0 | 140 | 520 | |
8/1854 | 20 | 150 | 800 | |
9/1854 | 220 | 230 | 740 | |
10/1854 | 305 | 310 | 600 | |
11/1854 | 480 | 290 | 820 | |
12/1854 | 295 | 310 | 1100 | |
1/1855 | 230 | 460 | 1440 |
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
$(document).ready(function(){ | |
// Take care of the initial page load | |
$(".tabs-menu li:first, .tabs-content:first").addClass("active"); | |
$(".tabs-content:not(:first)").hide(); | |
// Capture clicks on the tabs menu. Set the clicked menu item | |
// to active. Show the corresponding | |
// content block (by index) and hide all others. | |
$(".tabs-menu > li > a").click(function(e){ | |
var index = $('.tabs-menu li').index($(this).parent('li')); |
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
# make sure referer is set | |
if ((isset($_SERVER['HTTP_REFERER'])) and ($_SERVER['HTTP_REFERER']!= '')) { | |
$url = urldecode($_SERVER['HTTP_REFERER']); | |
$url_ary = parse_url($url); | |
# make sure referer matches our domain (hardcoded as WEB_ROOT global variable) | |
if (($url_ary[scheme].'://'.$url_ary[host]).'/' == WEB_ROOT) { | |
# grab path, remove slash | |
$url_path = substr($url_ary[path], 1); | |
# redirect with message and id |
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
def update_multiple | |
@items = Item.find(params[:item_ids]) | |
@items.each do |item| | |
item.attributes = params[:item].reject { |k,v| v.blank? } | |
end | |
if @items.all?(&:valid?) | |
@items.each(&:save!) | |
flash[:notice] = "Updated items!" | |
redirect_to items_path | |
else |
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
def update_multiple | |
@items = Item.find(params[:item_ids]) | |
@items.each do |item| | |
item.update_attributes!(params[:item].reject { |k,v| v.blank? }) | |
end | |
flash[:notice] = "Updated items!" | |
redirect_to items_path | |
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
<% form_for @event do |f| %> | |
<%= f.error_messages %> | |
<p> | |
<%= f.label :name %><br /> | |
<%= f.text_field :name %> | |
</p> | |
<% f.fields_for :category do |category_form| %> | |
<%= category_form.label :name %> |
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
task :default => :test | |
task :environment do | |
$rails_rake_task = true | |
require(File.join(RAILS_ROOT, 'config', 'environment')) | |
end | |
task :rails_env do | |
unless defined? RAILS_ENV | |
RAILS_ENV = ENV['RAILS_ENV'] ||= 'development' | |
end |