checklist_items_controller.rb 668 B

12345678910111213141516171819202122232425262728293031
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class ChecklistItemsController < ApplicationController
  3. prepend_before_action :authenticate_and_authorize!
  4. def show
  5. model_show_render(Checklist::Item, existing_item_params)
  6. end
  7. def create
  8. model_create_render(Checklist::Item, new_item_params)
  9. end
  10. def update
  11. model_update_render(Checklist::Item, existing_item_params)
  12. end
  13. def destroy
  14. model_destroy_render(Checklist::Item, existing_item_params)
  15. end
  16. private
  17. def new_item_params
  18. params.permit(:text, :checklist_id)
  19. end
  20. def existing_item_params
  21. params.permit(:text, :id, :checked)
  22. end
  23. end