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
preexec () { :; } | |
preexec_invoke_exec () { | |
if [[ -a Gemfile ]]; then | |
bundle exec $* | |
else | |
command $* | |
fi | |
} | |
trap 'preexec_invoke_exec' DEBUG |
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 AssignmentsController < ApplicationController | |
def show | |
@assignment = Assignment.find(params[:id]) | |
end | |
def new | |
end | |
def index | |
@assignments = Assignment.all |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title>Application Test</title> | |
<%= render 'layouts/stylesheets' %> | |
<%= javascript_include_tag :defaults %> | |
</head> | |
<body> | |
<div class="container"> |
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
<div class="box"> | |
<div class="quiet">Weeks: <%= assignment_statistics_weeks %></div> | |
<div class="quiet">Probability: <%= sprintf("%.1f",assignment_statistics_probability) %>%</div> | |
<div class="quiet">Geometry: <%= sprintf("%.1f",assignment_statistics_geometry) %>%</div> | |
</div> |
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 AssignmentsHelper | |
def assignment_statistics_probability | |
(@assignments.map {|assignment| assignment.probability_grade }.inject(:+) / (@assignments.length.to_f * 12)) * 100 | |
end | |
def assignment_statistics_geometry | |
(@assignments.map {|assignment| assignment.geometry_grade }.inject(:+) / (@assignments.length.to_f * 12)) * 100 | |
end | |
def assignment_statistics_weeks | |
@assignments.length | |
end |