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