From 3d4f9f2c280f9d85722951fa5850ca00a7e80aac Mon Sep 17 00:00:00 2001 From: hellekin Date: Thu, 29 Oct 2020 22:40:35 +0100 Subject: REUSE: Add AGPL-3.0-or-later to app/* --- app/controllers/categories_controller.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 app/controllers/categories_controller.rb (limited to 'app/controllers/categories_controller.rb') diff --git a/app/controllers/categories_controller.rb b/app/controllers/categories_controller.rb new file mode 100644 index 0000000..40f1ff5 --- /dev/null +++ b/app/controllers/categories_controller.rb @@ -0,0 +1,23 @@ +# SPDX-FileCopyrightText: 2020 IN COMMON Collective +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +class CategoriesController < ApplicationController + before_action :set_category, only: [:new, :show, :edit, :update, :delete, :destroy] + + def index + end + + def show + @category = Category.find(params[:id]) + end + + def edit + end + + private + + def set_category + @category = Category.find_by(id: params[:id]) || Category.new + end +end -- cgit v1.2.3