link_to(body, url, html_options = {})
link_to(body, url_options = {}, html_options = {})
link_to(options = {}, html_options = {}) do
end
link_to(url, html_options = {}) do
end
http://jsfiddle.net/megYe/ |
<form name="sign_up" action="#" method="post"> | |
<label for="email">Email</label> | |
<input type="text" name="email" /> | |
<label for="password">Password</label> | |
<input type="password" name="password" /> | |
<button type="submit">Sign Up</button> | |
<ul id="errors"></ul> | |
</form> |
.container { | |
/* | |
If you have a block-level element of a certain width, margin: 0 auto; | |
will how you center it inside its parent container. | |
See: http://bluerobot.com/web/css/center1.html | |
Don't change the container width. | |
*/ | |
margin: 0 auto; |
.container { | |
/* | |
If you have a block-level element of a certain width, margin: 0 auto; | |
will how you center it inside its parent container. | |
See: http://bluerobot.com/web/css/center1.html | |
Don't change the container width. | |
*/ | |
margin: 0 auto; |
https://github.com/tinybeauts/flashcards_web_app.git |
class Cohort < Database::Model | |
self.table_name = 'cohorts' | |
attr_reader :attributes, :old_attributes | |
# e.g., Cohort.new(:id => 1, :name => 'Alpha', :created_at => '2012-12-01 05:54:30') | |
def [](attribute) |
<!-- Code goes here --> | |
require 'csv' | |
require 'sqlite3' | |
class CongressParser | |
$db = SQLite3::Database.new "congress_members.db" | |
attr_accessor :file, :congress_members | |
def initialize(file) | |
@file = file |
class Cohort < Database::Model | |
def self.all | |
Database::Model.execute("SELECT * FROM cohorts").map do |row| | |
Cohort.new(row) | |
end | |
end | |
def self.create(attributes) | |
record = self.new(attributes) | |
record.save |
Count Queries | |
1. There are 240 Republican representatives. | |
2. There are 187 Democratic representatives. | |
3. There are 51 Democratic senators, 47 Republican senators. | |
The questions asks for "representatives", but the details below it ask to specify if it's a Rep or Sen, so we've | |
compiled the lists using all Rep's and Sen's. | |
select name, location, party, substr(name, 0, 4), years_in_congress from congress_members order by grade_level_since_1996 limit 10; |