taskbar_controller.rb 771 B

1234567891011121314151617181920212223242526272829303132333435
  1. # Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
  2. class TaskbarController < ApplicationController
  3. prepend_before_action -> { authorize! }, only: %i[show update destroy]
  4. prepend_before_action :authentication_check
  5. before_action :set_task_user_param, only: %i[create update]
  6. def index
  7. current_user_tasks = Taskbar.where(user_id: current_user.id)
  8. model_index_render_result(current_user_tasks)
  9. end
  10. def show
  11. model_create_render(Taskbar, params)
  12. end
  13. def create
  14. model_create_render(Taskbar, params)
  15. end
  16. def update
  17. model_update_render(Taskbar, params)
  18. end
  19. def destroy
  20. model_destroy_render(Taskbar, params)
  21. end
  22. private
  23. def set_task_user_param
  24. params[:user_id] = current_user.id
  25. end
  26. end