diff --git a/Gemfile b/Gemfile index 90253a5..4585a64 100644 --- a/Gemfile +++ b/Gemfile @@ -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' diff --git a/Gemfile.lock b/Gemfile.lock index e956e79..b91f30e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) @@ -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) diff --git a/app/assets/javascripts/application.coffee b/app/assets/javascripts/application.coffee index 8f10d6c..32afbb6 100644 --- a/app/assets/javascripts/application.coffee +++ b/app/assets/javascripts/application.coffee @@ -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 . + diff --git a/app/assets/javascripts/home.coffee b/app/assets/javascripts/home.coffee new file mode 100644 index 0000000..24f83d1 --- /dev/null +++ b/app/assets/javascripts/home.coffee @@ -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/ diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 43e7c5f..5cf4586 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -2,5 +2,6 @@ *= require_tree . *= require_self */ +@import "bootstrap-sprockets"; @import "bootstrap"; diff --git a/app/assets/stylesheets/home.scss b/app/assets/stylesheets/home.scss new file mode 100644 index 0000000..e69de29 diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb new file mode 100644 index 0000000..9013fd4 --- /dev/null +++ b/app/controllers/home_controller.rb @@ -0,0 +1,5 @@ +class HomeController < ApplicationController + def index +# render html:"hello world" + end +end diff --git a/app/helpers/home_helper.rb b/app/helpers/home_helper.rb new file mode 100644 index 0000000..23de56a --- /dev/null +++ b/app/helpers/home_helper.rb @@ -0,0 +1,2 @@ +module HomeHelper +end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb new file mode 100644 index 0000000..76dd392 --- /dev/null +++ b/app/views/home/index.html.erb @@ -0,0 +1,8 @@ +
+

Welcome to the Sample App

+

+ This is the home page for the + Ruby on Rails Tutorial + sample application. +

+
diff --git a/config/routes.rb b/config/routes.rb index 1daf9a4..d00745b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,2 +1,3 @@ Rails.application.routes.draw do + root 'home#index' end diff --git a/test/controllers/home_controller_test.rb b/test/controllers/home_controller_test.rb new file mode 100644 index 0000000..3e06bf0 --- /dev/null +++ b/test/controllers/home_controller_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class HomeControllerTest < ActionDispatch::IntegrationTest + # test "the truth" do + # assert true + # end +end