Commit 4f818bb9 by tady

bootstrap html

parent 23af1ed4
......@@ -43,3 +43,5 @@ end
# Use debugger
# gem 'debugger', group: [:development, :test]
gem 'bootstrap-sass-rails'
......@@ -27,6 +27,9 @@ GEM
tzinfo (~> 0.3.37)
arel (4.0.1)
atomic (1.1.14)
bootstrap-sass-rails (3.0.2.1)
railties (>= 3.1.0)
sass-rails (>= 3.1.0)
builder (3.1.4)
coffee-rails (4.0.1)
coffee-script (>= 2.2.0)
......@@ -108,6 +111,7 @@ PLATFORMS
ruby
DEPENDENCIES
bootstrap-sass-rails
coffee-rails (~> 4.0.0)
jbuilder (~> 1.2)
jquery-rails
......
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
......@@ -10,4 +10,37 @@
*
*= require_self
*= require_tree .
*= require twitter/bootstrap
*/
body {
padding-top: 70px;
}
.navbar-brand{
background-color: #00FF7F;
}
.box-text {
padding: 9px 14px;
margin-left: 0;
margin-right: 0;
background-color: #fff;
border-width: 1px;
border-color: #ddd;
border: 1px solid #e1e1e8;
border-radius: 4px 4px 0 0;
box-shadow: none;
}
.box-highlight {
padding: 9px 14px;
margin-bottom: 14px;
background-color: #f7f7f9;
border: 1px solid #e1e1e8;
border-radius: 4px;
}
.box-text + .box-highlight{
border-top-left-radius: 0px;
border-top-right-radius: 0px;
}
// Place all the styles related to the posts controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
class PostsController < ApplicationController
def index
end
end
module PostsHelper
end
class Post < ActiveRecord::Base
end
<!DOCTYPE html>
<html>
<html lang="ja">
<head>
<title>Rendezvous</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= csrf_meta_tags %>
</head>
<body>
<%= yield %>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Rendezvous</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<form class="navbar-form navbar-left" role="search">
<div class="form-group">
<input type="text" class="form-control" placeholder="Search">
</div>
<button type="submit" class="btn btn-default">
<span class="glyphicon glyphicon-search"></span>
</button>
</form>
<ul class="nav navbar-nav navbar-right">
<li><a href="#">Post</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">tady <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="#">Action</a></li>
<li><a href="#">Another action</a></li>
<li><a href="#">Something else here</a></li>
<li class="divider"></li>
<li><a href="#">Separated link</a></li>
</ul>
</li>
</ul>
</div><!-- /.navbar-collapse -->
</div><!-- /.container -->
</nav>
<div class="container">
<div class="row">
<div class="col-xs-6 col-md-4" id="sidebar" role="navigation">
<div class="input-group">
<input type="text" class="form-control">
<span class="input-group-btn">
<button class="btn btn-default" type="button">
<span class="glyphicon glyphicon-filter"></span>
</button>
</span>
</div><!-- /input-group -->
<div class="list-group">
<a href="#" class="list-group-item active">Link</a>
<a href="#" class="list-group-item">Link</a>
<a href="#" class="list-group-item">Link</a>
<a href="#" class="list-group-item">Link</a>
<a href="#" class="list-group-item">Link</a>
<a href="#" class="list-group-item">Link</a>
<a href="#" class="list-group-item">Link</a>
<a href="#" class="list-group-item">Link</a>
<a href="#" class="list-group-item">Link</a>
<a href="#" class="list-group-item">Link</a>
</div>
</div><!--/span-->
<div class="col-xs-12 col-sm-6 col-md-8">
<h2>最新の投稿</h2>
<div class="box-text">
<h3>Railsで簡単にページングする方法</h3>
</div>
<div class="box-highlight">
<span class="label label-primary">Rails (4.x.x)</span>
<span class="label label-primary">日報</span>
<a href="#">@tady</a>
<span>2013/11/29 17:31:18</span>
</div>
<div class="box-text">
<h3>Railsで簡単にページングする方法</h3>
</div>
<div class="box-highlight">
<span class="label label-primary">Rails (4.x.x)</span>
<span class="label label-primary">日報</span>
</div>
<div class="box-text">
<h3>Railsで簡単にページングする方法</h3>
</div>
<div class="box-highlight">
<span class="label label-primary">Rails (4.x.x)</span>
<span class="label label-primary">日報</span>
</div>
<h2>人気の投稿</h2>
<div class="box-text">
<h3>Railsで簡単にページングする方法</h3>
</div>
<div class="box-highlight">
<span class="label label-primary">Rails (4.x.x)</span>
<span class="label label-primary">日報</span>
<a href="#">@tady</a>
<span>2013/11/29 17:31:18</span>
</div>
<%= yield %>
</div><!--/span-->
</div><!--/row-->
<hr>
<footer>
<p>&copy; tady</p>
</footer>
</div><!--/.container-->
</body>
</html>
<h1>Posts#index</h1>
<p>Find me in app/views/posts/index.html.erb</p>
Rendezvous::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".
# You can have the root of your site routed with "root"
# root 'welcome#index'
root 'posts#index'
# Example of regular route:
# get 'products/:id' => 'catalog#view'
......
class CreatePosts < ActiveRecord::Migration
def change
create_table :posts do |t|
t.string :title
t.text :body
t.timestamps
end
end
end
# 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: 20131128163959) do
create_table "posts", force: true do |t|
t.string "title"
t.text "body"
t.datetime "created_at"
t.datetime "updated_at"
end
end
require 'test_helper'
class PostsControllerTest < ActionController::TestCase
test "should get index" do
get :index
assert_response :success
end
end
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
title: MyString
body: MyText
two:
title: MyString
body: MyText
require 'test_helper'
class PostsHelperTest < ActionView::TestCase
end
require 'test_helper'
class PostTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment