Skip to content

Commit

Permalink
added scss
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Zhang committed Dec 23, 2015
1 parent 5083407 commit 4188622
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.5'

gem 'bootstrap-sass'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
Expand Down
7 changes: 7 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,14 @@ GEM
tzinfo (~> 1.1)
ansi (1.5.0)
arel (6.0.3)
autoprefixer-rails (6.2.1)
execjs
json
binding_of_caller (0.7.3.pre1)
debug_inspector (>= 0.0.1)
bootstrap-sass (3.3.6)
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
builder (3.2.2)
byebug (3.4.0)
columnize (~> 0.8)
Expand Down Expand Up @@ -195,6 +201,7 @@ PLATFORMS
ruby

DEPENDENCIES
bootstrap-sass
byebug (= 3.4.0)
coffee-rails (~> 4.1.0)
guard-minitest (= 2.3.1)
Expand Down
3 changes: 3 additions & 0 deletions app/controllers/static_pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ def help

def about
end

def contact
end
end
11 changes: 8 additions & 3 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
<html>
<head>
<title><%= full_title(yield(:title)) %></title>
<%= stylesheet_link_tag 'application', media: 'all',
'data-turbolinks-track' => true %>
<%= stylesheet_link_tag 'application', media: 'all',
'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>
<%= render 'layouts/shim' %>
</head>
<body>
<%= yield %>
<%= render 'layouts/header' %>
<div class="container">
<%= yield %>
<%= render 'layouts/footer' %>
</div>
</body>
</html>
19 changes: 13 additions & 6 deletions app/views/static_pages/home.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
<div class="center jumbotron">
<h1>Welcome to the Sample App</h1>

<h1>Sample App</h1>
<p>
This is the home page for the
<a href="http://www.railstutorial.org/">Ruby on Rails Tutorial</a>
sample application.
</p>
<h2>
This is the home page for the
<a href="http://www.railstutorial.org/">Ruby on Rails Tutorial</a>
sample application.
</h2>

<%= link_to "Sign up now!", '#', class: "btn btn-lg btn-primary" %>
</div>

<%= link_to image_tag("rails.png", alt: "Rails logo"),
'http://rubyonrails.org/' %>
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
get 'static_pages/help'

get 'static_pages/about'
get 'static_pages/contact'

# 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 'static_pages#home'

# Example of regular route:
# get 'products/:id' => 'catalog#view'

Expand Down
7 changes: 7 additions & 0 deletions test/controllers/static_pages_controller_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'test_helper'

class StaticPagesControllerTest < ActionController::TestCase

test "should get home" do
get :home
assert_response :success
Expand All @@ -18,4 +19,10 @@ class StaticPagesControllerTest < ActionController::TestCase
assert_response :success
assert_select "title", "About | Ruby on Rails Tutorial Sample App"
end

test "should get contact" do
get :contact
assert_response :success
assert_select "title", "Contact | Ruby on Rails Tutorial Sample App"
end
end

0 comments on commit 4188622

Please sign in to comment.