Skip to content

Commit c54c69e

Browse files
committed
Well...ho kay
1 parent b379c12 commit c54c69e

File tree

15 files changed

+106
-0
lines changed

15 files changed

+106
-0
lines changed
+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/master.css.scss

+1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ h1 {
2222
font-weight: 100;
2323
font-size: 50px;
2424
line-height: 50px;
25+
color: white;
2526
}

app/assets/stylesheets/posts.css.scss

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

app/controllers/posts_controller.rb

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class PostsController < ApplicationController
2+
3+
def index
4+
5+
@posts = Post.all
6+
7+
end
8+
9+
10+
end

app/helpers/posts_helper.rb

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

app/models/post.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class Post < ActiveRecord::Base
2+
end

app/views/posts/index.html.erb

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<h1 class="text-center"> WELL...ho kay </h1>
2+
3+
<% @posts.each do |post| %>
4+
<div class="launch-box span3 text-center">
5+
<h1>
6+
<%= post.title %>
7+
</h1>
8+
<p>
9+
10+
<%= post.description %>
11+
12+
</p>
13+
</div>
14+
15+
16+
<% end %>

app/views/static_pages/index.html.erb

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
</h1>
88

9+
10+
<br/>
11+
912
<%= link_to 'Launch', '#', :class => 'btn btn-warning btn-large' %>
1013

1114
</div>

config/routes.rb

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
# You can have the root of your site routed with "root"
66
root 'static_pages#index.html.erb'
7+
resources :posts
78

89
# Example of regular route:
910
# get 'products/:id' => 'catalog#view'
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class CreatePosts < ActiveRecord::Migration
2+
def change
3+
create_table :posts do |t|
4+
t.string :title
5+
t.text :description
6+
7+
t.timestamps
8+
end
9+
end
10+
end

db/schema.rb

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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: 20140412223607) do
15+
16+
# These are extensions that must be enabled in order to support this database
17+
enable_extension "plpgsql"
18+
19+
create_table "posts", force: true do |t|
20+
t.string "title"
21+
t.text "description"
22+
t.datetime "created_at"
23+
t.datetime "updated_at"
24+
end
25+
26+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require 'test_helper'
2+
3+
class PostsControllerTest < ActionController::TestCase
4+
# test "the truth" do
5+
# assert true
6+
# end
7+
end

test/fixtures/posts.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2+
3+
# This model initially had no columns defined. If you add columns to the
4+
# model remove the '{}' from the fixture names and add the columns immediately
5+
# below each fixture, per the syntax in the comments below
6+
#
7+
one: {}
8+
# column: value
9+
#
10+
two: {}
11+
# column: value

test/helpers/posts_helper_test.rb

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
require 'test_helper'
2+
3+
class PostsHelperTest < ActionView::TestCase
4+
end

test/models/post_test.rb

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require 'test_helper'
2+
3+
class PostTest < ActiveSupport::TestCase
4+
# test "the truth" do
5+
# assert true
6+
# end
7+
end

0 commit comments

Comments
 (0)