Skip to content

Instantly share code, notes, and snippets.

View JohnAmican's full-sized avatar
🎯
Focusing

John Amicangelo JohnAmican

🎯
Focusing
View GitHub Profile
module BeforeRender
extend ActiveSupport::Concern
included do
define_callbacks :render
end
def render(*args, &block)
run_callbacks(:render) do
super
<!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 -->
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