Commit 218d995d by Mai Hoang Thai Ha

add layout, partial, Bootstrap

parent 73b919d4
Pipeline #1229 failed 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,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!", '#', 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
...@@ -4,4 +4,5 @@ Rails.application.routes.draw do ...@@ -4,4 +4,5 @@ Rails.application.routes.draw do
get 'static_pages/help' get 'static_pages/help'
get 'static_pages/about' get 'static_pages/about'
get 'static_pages/contact' get 'static_pages/contact'
get 'static_pages/example'
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