diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/categories_controller.rb | 5 | ||||
-rw-r--r-- | app/controllers/sections_controller.rb | 16 | ||||
-rw-r--r-- | app/controllers/users_controller.rb | 13 |
3 files changed, 23 insertions, 11 deletions
diff --git a/app/controllers/categories_controller.rb b/app/controllers/categories_controller.rb index 40f1ff5..da8d837 100644 --- a/app/controllers/categories_controller.rb +++ b/app/controllers/categories_controller.rb @@ -10,6 +10,11 @@ class CategoriesController < ApplicationController def show @category = Category.find(params[:id]) + + respond_to do |format| + format.html + format.js + end end def edit diff --git a/app/controllers/sections_controller.rb b/app/controllers/sections_controller.rb new file mode 100644 index 0000000..fed1d57 --- /dev/null +++ b/app/controllers/sections_controller.rb @@ -0,0 +1,16 @@ +# SPDX-FileCopyrightText: 2020 IN COMMON Collective <collective@incommon.cc> +# +# SPDX-License-Identifier: AGPL-3.0-or-later + +class SectionsController < ApplicationController + skip_before_action :verify_authenticity_token, only: :show + + def show + @section = Section.find(params[:id]) + respond_to do |format| + format.html + format.js + format.json + end + end +end diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 9a3cf74..f0479d1 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -3,18 +3,9 @@ # SPDX-License-Identifier: AGPL-3.0-or-later class UsersController < ApplicationController - # GET /my/users - # If you're a leader, you will see a list of Agent members + # GET /my/peers def index - begin - return 403 unless current_user.agencies.find_by(name: current_agent).leader? - rescue Exception => e - Rails.logger.info("Exception %s: %s" % [e.class, e.message]) - flash[:notice] = "Talk to your leader!" - redirect_to root_url and return - end - - @users = Agent.where(name: current_agent).members + @users = current_agent.members end # GET /my/account |