Skip to content

Commit

Permalink
修正appliation.coffee中写法的错误
Browse files Browse the repository at this point in the history
  • Loading branch information
jinhucheung committed Oct 11, 2016
1 parent 2c78d73 commit 1813021
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ source 'https://gems.ruby-china.org'
gem 'rails', '~> 5.0.0', '>= 5.0.0.1'

gem 'sprockets'
gem 'bootstrap-sass','~> 3.3.6'
gem 'sass-rails', '~> 5.0'
gem 'bootstrap','~> 4.0.0.alpha4'

gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
Expand Down
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ GEM
arel (7.1.2)
autoprefixer-rails (6.5.0.2)
execjs
bootstrap (4.0.0.alpha4)
autoprefixer-rails (>= 6.0.3)
sass (>= 3.4.19)
bootstrap-sass (3.3.7)
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
builder (3.2.2)
byebug (9.0.6)
coffee-rails (4.2.1)
Expand Down Expand Up @@ -159,7 +159,7 @@ PLATFORMS
ruby

DEPENDENCIES
bootstrap (~> 4.0.0.alpha4)
bootstrap-sass (~> 3.3.6)
byebug
coffee-rails (~> 4.2)
jbuilder (~> 2.5)
Expand Down
12 changes: 6 additions & 6 deletions app/assets/javascripts/application.coffee
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .
//
#= require jquery
#= require jquery_ujs
#= require bootstrap-sprockets
#= require turbolinks
#= require_tree .

3 changes: 3 additions & 0 deletions app/assets/javascripts/home.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 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/
1 change: 1 addition & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
*= require_tree .
*= require_self
*/
@import "bootstrap-sprockets";
@import "bootstrap";

Empty file.
5 changes: 5 additions & 0 deletions app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class HomeController < ApplicationController
def index
# render html:"hello world"
end
end
2 changes: 2 additions & 0 deletions app/helpers/home_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module HomeHelper
end
8 changes: 8 additions & 0 deletions app/views/home/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<header class="col-md-4">
<h1 class="col-md-5">Welcome to the Sample App</h1>
<h2>
This is the home page for the
<a href="http://www.railstutorial.org/">Ruby on Rails Tutorial</a>
sample application.
</h2>
</header>
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Rails.application.routes.draw do
root 'home#index'
end
7 changes: 7 additions & 0 deletions test/controllers/home_controller_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'test_helper'

class HomeControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end

0 comments on commit 1813021

Please sign in to comment.