Skip to content

Instantly share code, notes, and snippets.

View StephenFiser's full-sized avatar

Stephen Fiser StephenFiser

View GitHub Profile
> load 'dog.rb'
> bob = Dog.new("Bob", "Medium")
> bob.name
> load 'dog.rb'
> floyd = Dog.new
> floyd.bark
> floyd.walk
> ralph.send(:bark)
> ralph.class
> def ralph.bark
?> "Ruff!"
> end
> ralph.bark
> ralph.bark
<h3>New Todo Item:</h3>
<%= render 'form' %>
<h5>All Todos</h5>
<table>
<thead>
<tr>
<th>Title</th>
<th colspan="3"></th>
</tr>
</thead>
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3', group: :development
gem 'pg', group: :production
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
class Todo < ActiveRecord::Base
def hours_since_created
((Time.now - created_at) / 1.hour).round
end
end
<h3>New Todo Item:</h3>
<%= render 'form' %>
<h5>All Todos</h5>
<table>
<thead>
<tr>
<th>Title</th>
<th colspan="3"></th>
</tr>
</thead>