Commit fb216225 by Mai Hoang Thai Ha

Merge branch 'filling-in-layout' into 'master'

Filling in layout

See merge request !4
parents 652eb105 bf12793f
Pipeline #1241 canceled with stages
in 0 seconds
...@@ -5,7 +5,8 @@ ruby '3.0.1' ...@@ -5,7 +5,8 @@ ruby '3.0.1'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main'
gem 'rails', '~> 6.1.3', '>= 6.1.3.2' gem 'rails', '~> 6.1.3', '>= 6.1.3.2'
gem 'bootstrap-sass', '3.4.1'
gem 'autoprefixer-rails'
# Use Puma as the app server # Use Puma as the app server
gem 'puma', '~> 5.0' gem 'puma', '~> 5.0'
# Use SCSS for stylesheets # Use SCSS for stylesheets
......
...@@ -63,9 +63,14 @@ GEM ...@@ -63,9 +63,14 @@ GEM
addressable (2.7.0) addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0) public_suffix (>= 2.0.2, < 5.0)
ansi (1.5.0) ansi (1.5.0)
autoprefixer-rails (10.2.5.1)
execjs (> 0)
bindex (0.8.1) bindex (0.8.1)
bootsnap (1.7.5) bootsnap (1.7.5)
msgpack (~> 1.0) msgpack (~> 1.0)
bootstrap-sass (3.4.1)
autoprefixer-rails (>= 5.2.1)
sassc (>= 2.0.0)
builder (3.2.4) builder (3.2.4)
byebug (11.1.3) byebug (11.1.3)
capybara (3.35.3) capybara (3.35.3)
...@@ -81,6 +86,7 @@ GEM ...@@ -81,6 +86,7 @@ GEM
concurrent-ruby (1.1.8) concurrent-ruby (1.1.8)
crass (1.0.6) crass (1.0.6)
erubi (1.10.0) erubi (1.10.0)
execjs (2.8.1)
ffi (1.15.1) ffi (1.15.1)
formatador (0.2.5) formatador (0.2.5)
globalid (0.4.2) globalid (0.4.2)
...@@ -237,7 +243,9 @@ PLATFORMS ...@@ -237,7 +243,9 @@ PLATFORMS
x86_64-linux x86_64-linux
DEPENDENCIES DEPENDENCIES
autoprefixer-rails
bootsnap (>= 1.4.4) bootsnap (>= 1.4.4)
bootstrap-sass (= 3.4.1)
byebug byebug
capybara (>= 3.26) capybara (>= 3.26)
guard (= 2.16.2) guard (= 2.16.2)
......
...@@ -7,4 +7,7 @@ class StaticPagesController < ApplicationController ...@@ -7,4 +7,7 @@ class StaticPagesController < ApplicationController
def about def about
end end
def contact
end
end end
...@@ -7,6 +7,11 @@ import Rails from "@rails/ujs" ...@@ -7,6 +7,11 @@ import Rails from "@rails/ujs"
import Turbolinks from "turbolinks" import Turbolinks from "turbolinks"
import * as ActiveStorage from "@rails/activestorage" import * as ActiveStorage from "@rails/activestorage"
import "channels" import "channels"
//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require bootstrap-sprockets
//= require_tree .
Rails.start() Rails.start()
Turbolinks.start() Turbolinks.start()
......
...@@ -8,9 +8,16 @@ ...@@ -8,9 +8,16 @@
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
<%= render 'layouts/shim' %>
</head> </head>
<body> <body>
<%= render 'layouts/header' %>
<div class="container">
<%= yield %> <%= yield %>
<%= render 'layouts/footer' %>
</div>
</body> </body>
</html> </html>
\ No newline at end of file
<div class="center jumbotron">
<h1>Sample App</h1> <h1>Welcome to the Sample App</h1>
<p> <h2>
This is the home page for the This is the home page for the
<a href="https://www.railstutorial.org/">Ruby on Rails Tutorial</a> <a href="https://www.railstutorial.org/">Ruby on Rails Tutorial</a>
sample application. sample application.
</p> </h2>
\ No newline at end of file <%= link_to "Sign up now!", signup_path, class: "btn btn-lg btn-primary"%>
</div>
<%= link_to image_tag("rails.svg", alt: "Rails logo", width: "200"),
"https://rubyonrails.org" %>" %>
\ No newline at end of file
Rails.application.routes.draw do Rails.application.routes.draw do
get 'users/new'
root 'static_pages#home' root 'static_pages#home'
get 'static_pages/home' get '/help', to: 'static_pages#help'
get 'static_pages/help' get '/about', to: 'static_pages#about'
get 'static_pages/about' get '/contact', to: 'static_pages#contact'
get 'static_pages/contact' get '/signup', to: 'users#new'
end end
...@@ -9,25 +9,25 @@ class StaticPagesControllerTest < ActionDispatch::IntegrationTest ...@@ -9,25 +9,25 @@ class StaticPagesControllerTest < ActionDispatch::IntegrationTest
@base_title = "Ruby on Rails Tutorial Sample App" @base_title = "Ruby on Rails Tutorial Sample App"
end end
test "should get home" do test "should get home" do
get static_pages_home_url get root_path
assert_response :success assert_response :success
assert_select "title", "#{@base_title}" assert_select "title", "#{@base_title}"
end end
test "should get help" do test "should get help" do
get static_pages_help_url get help_path
assert_response :success assert_response :success
assert_select "title", "Help | #{@base_title}" assert_select "title", "Help | #{@base_title}"
end end
test "should get about" do test "should get about" do
get static_pages_about_url get about_path
assert_response :success assert_response :success
assert_select "title", "About | #{@base_title}" assert_select "title", "About | #{@base_title}"
end end
test "should get contact" do test "should get contact" do
get static_pages_contact_url get contact_path
assert_response :success assert_response :success
assert_select "title", "Contact | #{@base_title}" assert_select "title", "Contact | #{@base_title}"
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