This file contains hidden or 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
#if using has_secure_password in model | |
#use password_digest and confirm_password in migration | |
#otherwise password_hash in migration | |
#CONTOLLER | |
get '/' do | |
# Look in app/views/index.erb | |
erb :index | |
end |
This file contains hidden or 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> | |
<html> | |
<head> | |
<title>DOM manipulation with jQuery</title> | |
<!-- Add a link to jQuery CDN here script here --> | |
<script type="text/javascript" src="jquery_example.js"></script> | |
</head> | |
<body> |
This file contains hidden or 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 BoggleBoard | |
attr_reader :grid | |
def initialize(grid) | |
@grid = grid | |
raise ArgumentError.new("length of each row must be equal") if (grid.any? {|row| row.length != grid[0].length}) | |
end | |
def create_word(*coords) # creates a word based on given coordinates | |
coords.map {|coord| @grid[coord.first][coord.last]}.join("") |