Sha256: fce0176c0fae365118d9d6560abcf916b50506f84632919dc7b6267e0af144f7

Contents?: true

Size: 1.07 KB

Versions: 25

Compression:

Stored size: 1.07 KB

Contents

require_dependency "think_feel_do_engine/application_controller"

module ThinkFeelDoEngine
  module Manage
    # Users can view groups to CRUD and assign slideshows
    class GroupsController < ApplicationController
      before_action :authenticate_user!, :set_arm
      rescue_from ActiveRecord::RecordNotFound, with: :record_not_found

      def index
        authorize! :index, Group
        @groups = Group.all
      end

      def edit_tasks
        @group = @arm.groups
                 .includes(tasks: { bit_core_content_module: :tool })
                 .find(params[:id])
        authorize! :update, @group
        @task = current_user.tasks.build
        @content_modules = BitCore::ContentModule
                           .where(bit_core_tool_id: @arm.bit_core_tool_ids)
                           .includes(:tool)
      end

      private

      def set_arm
        @arm = Arm.find(params[:arm_id])
      end

      def record_not_found
        redirect_to main_app.root_path,
                    alert: "The group you are looking for no longer exists."
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
think_feel_do_engine-3.19.9 app/controllers/think_feel_do_engine/manage/groups_controller.rb
think_feel_do_engine-3.19.8 app/controllers/think_feel_do_engine/manage/groups_controller.rb
think_feel_do_engine-3.19.7 app/controllers/think_feel_do_engine/manage/groups_controller.rb
think_feel_do_engine-3.19.6 app/controllers/think_feel_do_engine/manage/groups_controller.rb
think_feel_do_engine-3.19.5 app/controllers/think_feel_do_engine/manage/groups_controller.rb
think_feel_do_engine-3.19.4 app/controllers/think_feel_do_engine/manage/groups_controller.rb
think_feel_do_engine-3.19.3 app/controllers/think_feel_do_engine/manage/groups_controller.rb
think_feel_do_engine-3.19.2 app/controllers/think_feel_do_engine/manage/groups_controller.rb
think_feel_do_engine-3.19.1 app/controllers/think_feel_do_engine/manage/groups_controller.rb
think_feel_do_engine-3.19.0 app/controllers/think_feel_do_engine/manage/groups_controller.rb
think_feel_do_engine-3.18.0 app/controllers/think_feel_do_engine/manage/groups_controller.rb
think_feel_do_engine-3.17.2 app/controllers/think_feel_do_engine/manage/groups_controller.rb
think_feel_do_engine-3.17.1 app/controllers/think_feel_do_engine/manage/groups_controller.rb
think_feel_do_engine-3.17.0 app/controllers/think_feel_do_engine/manage/groups_controller.rb
think_feel_do_engine-3.16.3 app/controllers/think_feel_do_engine/manage/groups_controller.rb
think_feel_do_engine-3.16.2 app/controllers/think_feel_do_engine/manage/groups_controller.rb
think_feel_do_engine-3.16.1 app/controllers/think_feel_do_engine/manage/groups_controller.rb
think_feel_do_engine-3.15.7 app/controllers/think_feel_do_engine/manage/groups_controller.rb
think_feel_do_engine-3.16.0 app/controllers/think_feel_do_engine/manage/groups_controller.rb
think_feel_do_engine-3.15.6 app/controllers/think_feel_do_engine/manage/groups_controller.rb