Add bootstrap and main application template

This commit is contained in:
maddiebaka 2023-10-22 15:03:45 -04:00
parent 1e80e2cfe4
commit 11710bfb68
6 changed files with 53 additions and 14 deletions

View File

@ -4,6 +4,8 @@ ruby "3.2.2"
gem "devise"
gem "http"
gem "bootstrap"
#gem "dartsass-sprockets"
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.1.1"

View File

@ -76,12 +76,18 @@ GEM
tzinfo (~> 2.0)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
autoprefixer-rails (10.4.15.0)
execjs (~> 2)
base64 (0.1.1)
bcrypt (3.1.19)
bigdecimal (3.1.4)
bindex (0.8.1)
bootsnap (1.16.0)
msgpack (~> 1.2)
bootstrap (5.3.1)
autoprefixer-rails (>= 9.1.0)
popper_js (>= 2.11.8, < 3)
sassc-rails (>= 2.0.0)
builder (3.2.4)
capybara (3.39.2)
addressable
@ -111,6 +117,7 @@ GEM
drb (2.1.1)
ruby2_keywords
erubi (1.12.0)
execjs (2.9.1)
factory_bot (6.2.1)
activesupport (>= 5.0.0)
factory_bot_rails (6.2.0)
@ -176,6 +183,7 @@ GEM
nokogiri (1.15.4-x86_64-linux)
racc (~> 1.4)
orm_adapter (0.5.0)
popper_js (2.11.8)
psych (5.1.1)
stringio
public_suffix (5.0.3)
@ -250,6 +258,14 @@ GEM
rspec-support (~> 3.12)
rspec-support (3.12.1)
ruby2_keywords (0.0.5)
sassc (2.4.0)
ffi (~> 1.9)
sassc-rails (2.1.2)
railties (>= 4.0.0)
sassc (>= 2.0)
sprockets (> 3.0)
sprockets-rails
tilt
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
@ -264,6 +280,7 @@ GEM
railties (>= 6.0.0)
stringio (3.0.8)
thor (1.2.2)
tilt (2.3.0)
timeout (0.4.0)
turbo-rails (1.5.0)
actionpack (>= 6.0.0)
@ -296,6 +313,7 @@ PLATFORMS
DEPENDENCIES
bootsnap
bootstrap
capybara
debug
devise

View File

@ -13,3 +13,5 @@
*= require_tree .
*= require_self
*/
@import "bootstrap";

View File

@ -1,6 +1,3 @@
<br/>
<br/>
<%= sanitize alphabetical_links, tags: ["a"] %>
<p><%= @parts_of_speech.count %> parts of speech entries in database</p>

View File

@ -11,16 +11,31 @@
</head>
<body>
<p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p>
<div style="display: block;">
<div class="container">
<div class="d-flex mb-3">
<div class="p-2">
<%= link_to "Dictionary", dictionary_index_path %>
</div>
<div class="ms-auto p-2">
<% if user_signed_in? %>
<p>Welcome <%= current_user.username %></p>
<%= link_to "Sign Out", destroy_user_session_path, data: { turbo_method: :delete } %>
<% else %>
<%= link_to "Sign In", new_user_session_path %>
<pre style="display: inline;">|</pre>
<%= link_to "Register", new_user_registration_path %>
<% end %>
</div>
</div>
</div>
<div class="container">
<div class="row justify-content-center">
<div class="col-8">
<p class="notice"><%= notice %></p>
<p class="alert"><%= alert %></p>
<%= yield %>
</div>
</div>
</div>
</body>
</html>

View File

@ -6,6 +6,11 @@ RSpec.describe "Root path", type: :request do
get root_path
expect(response).to have_http_status(200)
end
it "should have a link to the dictionary" do
get root_path
expect(response.body).to have_selector(%(a[href="#{dictionary_index_path}"]))
end
end
describe "logged out" do