Skip to content

Commit 4fb324e

Browse files
committed
Add home controller and button
1 parent d0108f8 commit 4fb324e

File tree

10 files changed

+47
-55
lines changed

10 files changed

+47
-55
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@
1515
/log/*
1616
!/log/.keep
1717
/tmp
18+
19+
*.DS_Store

app/assets/images/button.png

70.3 KB
Loading

app/assets/javascripts/home.coffee

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Place all the behaviors and hooks related to the matching controller here.
2+
# All this logic will automatically be available in application.js.
3+
# You can use CoffeeScript in this file: http://coffeescript.org/

app/assets/stylesheets/home.scss

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Place all the styles related to the home controller here.
2+
// They will automatically be included in application.css.
3+
// You can use Sass (SCSS) here: http://sass-lang.com/

app/controllers/home_controller.rb

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
class HomeController < ApplicationController
2+
def index
3+
end
4+
end

app/helpers/home_helper.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module HomeHelper
2+
end

app/views/home/index.html.erb

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<%= image_tag "button.png" %>

config/routes.rb

+1-55
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,4 @@
11
Rails.application.routes.draw do
2+
root 'home#index'
23
get 'users/new'
3-
4-
# The priority is based upon order of creation: first created -> highest priority.
5-
# See how all your routes lay out with "rake routes".
6-
7-
# You can have the root of your site routed with "root"
8-
# root 'welcome#index'
9-
10-
# Example of regular route:
11-
# get 'products/:id' => 'catalog#view'
12-
13-
# Example of named route that can be invoked with purchase_url(id: product.id)
14-
# get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
15-
16-
# Example resource route (maps HTTP verbs to controller actions automatically):
17-
# resources :products
18-
19-
# Example resource route with options:
20-
# resources :products do
21-
# member do
22-
# get 'short'
23-
# post 'toggle'
24-
# end
25-
#
26-
# collection do
27-
# get 'sold'
28-
# end
29-
# end
30-
31-
# Example resource route with sub-resources:
32-
# resources :products do
33-
# resources :comments, :sales
34-
# resource :seller
35-
# end
36-
37-
# Example resource route with more complex sub-resources:
38-
# resources :products do
39-
# resources :comments
40-
# resources :sales do
41-
# get 'recent', on: :collection
42-
# end
43-
# end
44-
45-
# Example resource route with concerns:
46-
# concern :toggleable do
47-
# post 'toggle'
48-
# end
49-
# resources :posts, concerns: :toggleable
50-
# resources :photos, concerns: :toggleable
51-
52-
# Example resource route within a namespace:
53-
# namespace :admin do
54-
# # Directs /admin/products/* to Admin::ProductsController
55-
# # (app/controllers/admin/products_controller.rb)
56-
# resources :products
57-
# end
584
end

db/schema.rb

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# encoding: UTF-8
2+
# This file is auto-generated from the current state of the database. Instead
3+
# of editing this file, please use the migrations feature of Active Record to
4+
# incrementally modify your database, and then regenerate this schema definition.
5+
#
6+
# Note that this schema.rb definition is the authoritative source for your
7+
# database schema. If you need to create the application database on another
8+
# system, you should be using db:schema:load, not running all the migrations
9+
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
10+
# you'll amass, the slower it'll run and the greater likelihood for issues).
11+
#
12+
# It's strongly recommended that you check this file into your version control system.
13+
14+
ActiveRecord::Schema.define(version: 20160615013423) do
15+
16+
create_table "users", force: :cascade do |t|
17+
t.string "name"
18+
t.string "email"
19+
t.integer "score"
20+
t.datetime "created_at", null: false
21+
t.datetime "updated_at", null: false
22+
end
23+
24+
end
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require 'test_helper'
2+
3+
class HomeControllerTest < ActionController::TestCase
4+
# test "the truth" do
5+
# assert true
6+
# end
7+
end

0 commit comments

Comments
 (0)