From 0f83b3a2e68b167f6dc619626a2052fb09bc48c4 Mon Sep 17 00:00:00 2001 From: Mandydidi <90797792+Mandydidi@users.noreply.github.com> Date: Sat, 17 Dec 2022 14:34:43 -0500 Subject: [PATCH] feat: comment could @ people (#112) --- Gemfile | 1 + Gemfile.lock | 2 ++ app/assets/javascripts/application.js | 1 + app/assets/stylesheets/application.scss | 1 + app/controllers/events_controller.rb | 1 + app/views/events/show.html.erb | 5 +++++ 6 files changed, 11 insertions(+) diff --git a/Gemfile b/Gemfile index a2ace39..6d78a9b 100644 --- a/Gemfile +++ b/Gemfile @@ -41,3 +41,4 @@ gem 'bootstrap-sass' gem 'sass-rails', '~> 5.0.3' gem 'uglifier', '>= 2.7.1' gem 'jquery-rails' +gem 'jquery-atwho-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 5f959aa..a54ffe3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -119,6 +119,7 @@ GEM hashie (5.0.0) i18n (0.9.5) concurrent-ruby (~> 1.0) + jquery-atwho-rails (1.5.4) jquery-rails (4.5.0) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) @@ -299,6 +300,7 @@ DEPENDENCIES dotenv-rails factory_girl (~> 4.0) guard + jquery-atwho-rails jquery-rails launchy omniauth diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 646c5ab..166269e 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -13,3 +13,4 @@ //= require jquery //= require jquery_ujs //= require_tree . +//= require jquery.atwho \ No newline at end of file diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index d27cc6a..2e5f933 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -12,6 +12,7 @@ * *= require_tree . *= require_self + //= require jquery.atwho */ // @import "bootstrap"; diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb index 8d39ad8..d1e46be 100644 --- a/app/controllers/events_controller.rb +++ b/app/controllers/events_controller.rb @@ -17,6 +17,7 @@ def show @attendees[person] = User.find_by(username: person) end @user_id = User.find_by(username: u).id + @usernames = User.pluck(:username) end def index diff --git a/app/views/events/show.html.erb b/app/views/events/show.html.erb index 076d02c..c77c698 100644 --- a/app/views/events/show.html.erb +++ b/app/views/events/show.html.erb @@ -194,3 +194,8 @@ <% end %> <%# %> + + \ No newline at end of file