@@ -1,37 +1,29 @@ | |||||
source 'https://rubygems.org' | source 'https://rubygems.org' | ||||
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |||||
gem 'rails', '4.2.0' | gem 'rails', '4.2.0' | ||||
# Use sqlite3 as the database for Active Record | |||||
gem 'sqlite3' | gem 'sqlite3' | ||||
# Use SCSS for stylesheets | |||||
gem 'sass-rails', '~> 5.0' | |||||
# Use Uglifier as compressor for JavaScript assets | |||||
gem 'uglifier', '>= 1.3.0' | gem 'uglifier', '>= 1.3.0' | ||||
# Use CoffeeScript for .coffee assets and views | |||||
gem 'coffee-rails', '~> 4.1.0' | |||||
gem 'jquery-rails' | |||||
# At this point, avoid using SASS or CoffeeScript | |||||
# gem 'sass-rails', '~> 5.0' | |||||
# gem 'coffee-rails', '~> 4.1.0' | |||||
# Avoid Turbolinks for now (https://github.com/rails/turbolinks) | |||||
# gem 'turbolinks' | |||||
# See https://github.com/sstephenson/execjs#readme for more supported runtimes | # See https://github.com/sstephenson/execjs#readme for more supported runtimes | ||||
# gem 'therubyracer', platforms: :ruby | # gem 'therubyracer', platforms: :ruby | ||||
# Use jquery as the JavaScript library | |||||
gem 'jquery-rails' | |||||
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks | |||||
gem 'turbolinks' | |||||
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder | # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder | ||||
gem 'jbuilder', '~> 2.0' | |||||
# gem 'jbuilder', '~> 2.0' | |||||
# bundle exec rake doc:rails generates the API under doc/api. | # bundle exec rake doc:rails generates the API under doc/api. | ||||
gem 'sdoc', '~> 0.4.0', group: :doc | |||||
# gem 'sdoc', '~> 0.4.0', group: :doc | |||||
# Use ActiveModel has_secure_password | # Use ActiveModel has_secure_password | ||||
# gem 'bcrypt', '~> 3.1.7' | # gem 'bcrypt', '~> 3.1.7' | ||||
# Use Unicorn as the app server | |||||
# gem 'unicorn' | |||||
# Use Capistrano for deployment | |||||
# gem 'capistrano-rails', group: :development | |||||
group :development, :test do | group :development, :test do | ||||
# Call 'byebug' anywhere in the code to stop execution and get a debugger console | # Call 'byebug' anywhere in the code to stop execution and get a debugger console | ||||
gem 'byebug' | gem 'byebug' | ||||
@@ -40,6 +32,5 @@ group :development, :test do | |||||
gem 'web-console', '~> 2.0' | gem 'web-console', '~> 2.0' | ||||
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring | # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring | ||||
gem 'spring' | |||||
# gem 'spring' | |||||
end | end | ||||
@@ -44,13 +44,6 @@ GEM | |||||
columnize (~> 0.8) | columnize (~> 0.8) | ||||
debugger-linecache (~> 1.2) | debugger-linecache (~> 1.2) | ||||
slop (~> 3.6) | slop (~> 3.6) | ||||
coffee-rails (4.1.0) | |||||
coffee-script (>= 2.2.0) | |||||
railties (>= 4.0.0, < 5.0) | |||||
coffee-script (2.3.0) | |||||
coffee-script-source | |||||
execjs | |||||
coffee-script-source (1.9.1) | |||||
columnize (0.9.0) | columnize (0.9.0) | ||||
debug_inspector (0.0.2) | debug_inspector (0.0.2) | ||||
debugger-linecache (1.2.0) | debugger-linecache (1.2.0) | ||||
@@ -60,9 +53,6 @@ GEM | |||||
activesupport (>= 4.1.0) | activesupport (>= 4.1.0) | ||||
hike (1.2.3) | hike (1.2.3) | ||||
i18n (0.7.0) | i18n (0.7.0) | ||||
jbuilder (2.2.11) | |||||
activesupport (>= 3.0.0, < 5) | |||||
multi_json (~> 1.2) | |||||
jquery-rails (4.0.3) | jquery-rails (4.0.3) | ||||
rails-dom-testing (~> 1.0) | rails-dom-testing (~> 1.0) | ||||
railties (>= 4.2.0) | railties (>= 4.2.0) | ||||
@@ -98,7 +88,7 @@ GEM | |||||
activesupport (>= 4.2.0.beta, < 5.0) | activesupport (>= 4.2.0.beta, < 5.0) | ||||
nokogiri (~> 1.6.0) | nokogiri (~> 1.6.0) | ||||
rails-deprecated_sanitizer (>= 1.0.1) | rails-deprecated_sanitizer (>= 1.0.1) | ||||
rails-html-sanitizer (1.0.1) | |||||
rails-html-sanitizer (1.0.2) | |||||
loofah (~> 2.0) | loofah (~> 2.0) | ||||
railties (4.2.0) | railties (4.2.0) | ||||
actionpack (= 4.2.0) | actionpack (= 4.2.0) | ||||
@@ -106,20 +96,7 @@ GEM | |||||
rake (>= 0.8.7) | rake (>= 0.8.7) | ||||
thor (>= 0.18.1, < 2.0) | thor (>= 0.18.1, < 2.0) | ||||
rake (10.4.2) | rake (10.4.2) | ||||
rdoc (4.2.0) | |||||
json (~> 1.4) | |||||
sass (3.4.13) | |||||
sass-rails (5.0.1) | |||||
railties (>= 4.0.0, < 5.0) | |||||
sass (~> 3.1) | |||||
sprockets (>= 2.8, < 4.0) | |||||
sprockets-rails (>= 2.0, < 4.0) | |||||
tilt (~> 1.1) | |||||
sdoc (0.4.1) | |||||
json (~> 1.7, >= 1.7.7) | |||||
rdoc (~> 4.0) | |||||
slop (3.6.0) | slop (3.6.0) | ||||
spring (1.3.3) | |||||
sprockets (2.12.3) | sprockets (2.12.3) | ||||
hike (~> 1.2) | hike (~> 1.2) | ||||
multi_json (~> 1.0) | multi_json (~> 1.0) | ||||
@@ -131,10 +108,8 @@ GEM | |||||
sprockets (>= 2.8, < 4.0) | sprockets (>= 2.8, < 4.0) | ||||
sqlite3 (1.3.10) | sqlite3 (1.3.10) | ||||
thor (0.19.1) | thor (0.19.1) | ||||
thread_safe (0.3.4) | |||||
thread_safe (0.3.5) | |||||
tilt (1.4.1) | tilt (1.4.1) | ||||
turbolinks (2.5.3) | |||||
coffee-rails | |||||
tzinfo (1.2.2) | tzinfo (1.2.2) | ||||
thread_safe (~> 0.1) | thread_safe (~> 0.1) | ||||
uglifier (2.7.1) | uglifier (2.7.1) | ||||
@@ -151,14 +126,8 @@ PLATFORMS | |||||
DEPENDENCIES | DEPENDENCIES | ||||
byebug | byebug | ||||
coffee-rails (~> 4.1.0) | |||||
jbuilder (~> 2.0) | |||||
jquery-rails | jquery-rails | ||||
rails (= 4.2.0) | rails (= 4.2.0) | ||||
sass-rails (~> 5.0) | |||||
sdoc (~> 0.4.0) | |||||
spring | |||||
sqlite3 | sqlite3 | ||||
turbolinks | |||||
uglifier (>= 1.3.0) | uglifier (>= 1.3.0) | ||||
web-console (~> 2.0) | web-console (~> 2.0) |
@@ -12,5 +12,4 @@ | |||||
// | // | ||||
//= require jquery | //= require jquery | ||||
//= require jquery_ujs | //= require jquery_ujs | ||||
//= require turbolinks | |||||
//= require_tree . | //= require_tree . |
@@ -0,0 +1,2 @@ | |||||
// Place all the behaviors and hooks related to the matching controller here. | |||||
// All this logic will automatically be available in application.js. |
@@ -0,0 +1,2 @@ | |||||
// Place all the behaviors and hooks related to the matching controller here. | |||||
// All this logic will automatically be available in application.js. |
@@ -0,0 +1,4 @@ | |||||
/* | |||||
Place all the styles related to the matching controller here. | |||||
They will automatically be included in application.css. | |||||
*/ |
@@ -0,0 +1,4 @@ | |||||
/* | |||||
Place all the styles related to the matching controller here. | |||||
They will automatically be included in application.css. | |||||
*/ |
@@ -2,9 +2,4 @@ class ApplicationController < ActionController::Base | |||||
# Prevent CSRF attacks by raising an exception. | # Prevent CSRF attacks by raising an exception. | ||||
# For APIs, you may want to use :null_session instead. | # For APIs, you may want to use :null_session instead. | ||||
protect_from_forgery with: :exception | protect_from_forgery with: :exception | ||||
def hello | |||||
render text: "hello, world!" | |||||
end | |||||
end | end |
@@ -0,0 +1,4 @@ | |||||
class ToolsController < ApplicationController | |||||
def index | |||||
end | |||||
end |
@@ -0,0 +1,7 @@ | |||||
class UsersController < ApplicationController | |||||
def create | |||||
end | |||||
def login | |||||
end | |||||
end |
@@ -1,2 +1,7 @@ | |||||
module ApplicationHelper | module ApplicationHelper | ||||
def get_title(title = '') | |||||
base = 'Calefaction' | |||||
title.empty? ? base : "#{title} : #{base}" | |||||
end | |||||
end | end |
@@ -0,0 +1,2 @@ | |||||
module ToolsHelper | |||||
end |
@@ -0,0 +1,2 @@ | |||||
module UsersHelper | |||||
end |
@@ -0,0 +1,2 @@ | |||||
class User < ActiveRecord::Base | |||||
end |
@@ -1,10 +1,10 @@ | |||||
<!DOCTYPE html> | <!DOCTYPE html> | ||||
<html> | <html> | ||||
<head> | <head> | ||||
<title>Calefaction</title> | |||||
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> | |||||
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> | |||||
<%= csrf_meta_tags %> | |||||
<title><%= get_title(yield(:title)) %></title> | |||||
<%= stylesheet_link_tag 'application', media: 'all' %> | |||||
<%= javascript_include_tag 'application' %> | |||||
<%= csrf_meta_tags %> | |||||
</head> | </head> | ||||
<body> | <body> | ||||
@@ -0,0 +1,2 @@ | |||||
<h1>Tools#index</h1> | |||||
<p>Find me in app/views/tools/index.html.erb</p> |
@@ -0,0 +1,4 @@ | |||||
<% provide(:title, 'Signup') %> | |||||
<h1>Users#create</h1> | |||||
<p>Find me in app/views/users/create.html.erb</p> |
@@ -0,0 +1,4 @@ | |||||
<% provide(:title, 'Login') %> | |||||
<h1>Users#login</h1> | |||||
<p>Find me in app/views/users/login.html.erb</p> |
@@ -1,9 +1,9 @@ | |||||
Rails.application.routes.draw do | Rails.application.routes.draw do | ||||
# The priority is based upon order of creation: first created -> highest priority. | |||||
# See how all your routes lay out with "rake routes". | |||||
root 'tools#index' | |||||
get '/signup' => 'users#create' | |||||
get '/login' => 'users#login' | |||||
# You can have the root of your site routed with "root" | |||||
root 'application#hello' | |||||
# Example of regular route: | # Example of regular route: | ||||
# get 'products/:id' => 'catalog#view' | # get 'products/:id' => 'catalog#view' | ||||
@@ -0,0 +1,12 @@ | |||||
class CreateUsers < ActiveRecord::Migration | |||||
def change | |||||
create_table :users do |t| | |||||
t.string :name | |||||
t.string :email | |||||
t.string :password_hash | |||||
t.boolean :is_admin | |||||
t.timestamps null: false | |||||
end | |||||
end | |||||
end |
@@ -0,0 +1,25 @@ | |||||
# encoding: UTF-8 | |||||
# This file is auto-generated from the current state of the database. Instead | |||||
# of editing this file, please use the migrations feature of Active Record to | |||||
# incrementally modify your database, and then regenerate this schema definition. | |||||
# | |||||
# Note that this schema.rb definition is the authoritative source for your | |||||
# database schema. If you need to create the application database on another | |||||
# system, you should be using db:schema:load, not running all the migrations | |||||
# from scratch. The latter is a flawed and unsustainable approach (the more migrations | |||||
# you'll amass, the slower it'll run and the greater likelihood for issues). | |||||
# | |||||
# It's strongly recommended that you check this file into your version control system. | |||||
ActiveRecord::Schema.define(version: 20150311175036) do | |||||
create_table "users", force: :cascade do |t| | |||||
t.string "name" | |||||
t.string "email" | |||||
t.string "password_hash" | |||||
t.boolean "is_admin" | |||||
t.datetime "created_at", null: false | |||||
t.datetime "updated_at", null: false | |||||
end | |||||
end |
@@ -0,0 +1,9 @@ | |||||
require 'test_helper' | |||||
class ToolsControllerTest < ActionController::TestCase | |||||
test "should get index" do | |||||
get :index | |||||
assert_response :success | |||||
end | |||||
end |
@@ -0,0 +1,14 @@ | |||||
require 'test_helper' | |||||
class UsersControllerTest < ActionController::TestCase | |||||
test "should get create" do | |||||
get :create | |||||
assert_response :success | |||||
end | |||||
test "should get login" do | |||||
get :login | |||||
assert_response :success | |||||
end | |||||
end |
@@ -0,0 +1,13 @@ | |||||
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html | |||||
one: | |||||
name: MyString | |||||
email: MyString | |||||
password_hash: MyString | |||||
is_admin: false | |||||
two: | |||||
name: MyString | |||||
email: MyString | |||||
password_hash: MyString | |||||
is_admin: false |
@@ -0,0 +1,7 @@ | |||||
require 'test_helper' | |||||
class UserTest < ActiveSupport::TestCase | |||||
# test "the truth" do | |||||
# assert true | |||||
# end | |||||
end |