diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 0000000..e94f814 --- /dev/null +++ b/.browserslistrc @@ -0,0 +1 @@ +defaults diff --git a/.gitignore b/.gitignore index 5fb66c9..fc6c040 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,10 @@ # Ignore master key for decrypting credentials and more. /config/master.key + +/public/packs +/public/packs-test +/node_modules +/yarn-error.log +yarn-debug.log* +.yarn-integrity diff --git a/Gemfile b/Gemfile index e13245a..909b3be 100644 --- a/Gemfile +++ b/Gemfile @@ -28,6 +28,8 @@ gem "jbuilder" gem 'devise' +gem 'webpacker' + # Use Redis adapter to run Action Cable in production # gem "redis", ">= 4.0.1" diff --git a/Gemfile.lock b/Gemfile.lock index d0b9c28..d476aee 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -168,6 +168,8 @@ GEM nio4r (~> 2.0) racc (1.7.3) rack (3.0.8) + rack-proxy (0.7.7) + rack rack-session (2.0.0) rack (>= 3.0.0) rack-test (2.1.0) @@ -220,6 +222,7 @@ GEM rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) + semantic_range (3.0.0) sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) @@ -251,6 +254,11 @@ GEM activemodel (>= 6.0.0) bindex (>= 0.4.0) railties (>= 6.0.0) + webpacker (5.4.4) + activesupport (>= 5.2) + rack-proxy (>= 0.6.1) + railties (>= 5.2) + semantic_range (>= 2.3.0) webrick (1.8.1) websocket (1.2.10) websocket-driver (0.7.6) @@ -284,6 +292,7 @@ DEPENDENCIES turbo-rails tzinfo-data web-console + webpacker RUBY VERSION ruby 3.2.2p53 diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index ddd546a..e3e0425 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -2,3 +2,8 @@ //= link_directory ../stylesheets .css //= link_tree ../../javascript .js //= link_tree ../../../vendor/javascript .js +//= link rails-ujs.js + + + + diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 95f2992..20dc067 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -1,4 +1,6 @@ class HomeController < ApplicationController + before_action :authenticate_user! + def index end end diff --git a/app/javascript/application.js b/app/javascript/packs/application.js similarity index 76% rename from app/javascript/application.js rename to app/javascript/packs/application.js index 0d7b494..cd79d94 100644 --- a/app/javascript/application.js +++ b/app/javascript/packs/application.js @@ -1,3 +1,6 @@ // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails import "@hotwired/turbo-rails" import "controllers" + +import Rails from '@rails/ujs'; +Rails.start(); diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 3899fcd..ee5159c 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -1,3 +1,6 @@
Hi Mariam. This is me. You should know this as you are sitting next to me.
-Boy I have a hard time remembering anything!
\ No newline at end of file +Boy I have a hard time remembering anything!
+ + +<%= link_to 'Sign Out', destroy_user_session_path, method: :delete, class: "btn btn-danger" %> diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 269858f..5156112 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -5,13 +5,40 @@<%= notice %>
<%= alert %>
- + +