diff --git a/Gemfile.lock b/Gemfile.lock index 0273070..833b390 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -434,6 +434,7 @@ PLATFORMS aarch64-linux x86_64-darwin-20 x86_64-darwin-21 + x86_64-darwin-22 x86_64-linux DEPENDENCIES diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5e000ad..465658e 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,3 +1,9 @@ class ApplicationController < ActionController::Base before_action :authenticate_user! -end \ No newline at end of file + + def execute_read_task + system('rake read') + flash[:notice] = "Read task executed!" + redirect_back_or_to root_path + end +end diff --git a/app/views/shared/_navigation_bar.html.erb b/app/views/shared/_navigation_bar.html.erb index 2f392a5..08e09f9 100644 --- a/app/views/shared/_navigation_bar.html.erb +++ b/app/views/shared/_navigation_bar.html.erb @@ -15,6 +15,10 @@ UpgradeJS Links +
  • + <%= button_to "Refresh List", execute_read_task_path, class: "inline-block border rounded py-1 px-3", method: :post %> +
  • +
  • <%= current_user.email %> <%= button_to "Sign out", ombu_labs_auth.destroy_user_session_path, method: :delete, class: "inline-block border rounded py-1 px-3" %> diff --git a/config/routes.rb b/config/routes.rb index 87e5671..431c0ab 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -4,6 +4,7 @@ resources :shares get '/shares/:id/clone', to: 'shares#clone', as: "clone" end + post 'execute_read_task', to: 'application#execute_read_task' mount OmbuLabs::Auth::Engine, at: '/', as: 'ombu_labs_auth' end