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 Classroom < ActiveRecord::Base | |
belongs_to :school | |
attr_accessible :code, :name, :school_id | |
validates :code, :name, :school_id, :presence => true | |
def school_name | |
school.name | |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>Beth's Page</title> | |
</head> | |
<body> | |
<div class="container"> | |
<!-- Ex. two column layout --> |
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 BeforeRender | |
extend ActiveSupport::Concern | |
included do | |
define_callbacks :render | |
end | |
def render(*args, &block) | |
run_callbacks(:render) do | |
super |
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
bundle = (name, opts) -> | |
_.extend opts, | |
fullPaths: true | |
cache: {} | |
packageCache: {} | |
b = browserify opts | |
rebundle = -> | |
b.bundle() |
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
gulp.task 'frontend-js', -> | |
bundle 'application.js', | |
entries: ["your/entry/file.cjsx"] # or `.coffee` or whatever | |
extensions: ['.coffee', '.cjsx'] | |
debug: true |
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
bundle 'server.js', | |
entries: ["your/entry/file.cjsx"] | |
extensions: ['.coffee', '.cjsx'] | |
builtins: false # already in node | |
commondir: false # already in node | |
detectGlobals: false # already in node | |
browserField: false # already in node | |
standalone: 'render' |
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 React | |
module Server | |
module Rendering | |
extend ActiveSupport::Concern | |
include ::BeforeRender | |
included do | |
before_render :set_rendered | |
attr_reader :rendered |
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
React = require 'react' | |
app = require './app' | |
module.exports = (data) -> React.renderToString app(data) |
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
CREATE UNIQUE INDEX trades_root_id_and_version ON trades (root_id, version); |
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
CREATE TABLE trades | |
( | |
id SERIAL NOT NULL CONSTRAINT trades_pkey PRIMARY KEY, | |
latest BOOLEAN NOT NULL, | |
root_id TEXT NOT NULL, | |
version INTEGER NOT NULL, | |
price INT | |
); |
OlderNewer