Sha256: 345eba5509f84ecec1557d5af11a14744ecc161790256a8ab94b96ff12ada25e

Contents?: true

Size: 805 Bytes

Versions: 13

Compression:

Stored size: 805 Bytes

Contents

# frozen_string_literal: true
require_dependency "think_feel_do_engine/application_controller"

module ThinkFeelDoEngine
  module Participants
    # Read Lesson content.
    class LessonsController < ApplicationController
      before_action :authenticate_participant!

      rescue_from ActiveRecord::RecordNotFound, with: :record_not_found

      layout "tool"

      def show
        @lesson = ContentModules::LessonModule.find(params[:id])
      end

      private

      def record_not_found
        arm = current_participant.active_membership.group.arm
        learn_tool = arm.bit_core_tools.find_by_type("Tools::Learn")

        redirect_to(
          navigator_context_url(arm_id: arm.id, context_name: learn_tool.title),
          alert: "Lesson not found"
        )
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
think_feel_do_engine-3.22.9 app/controllers/think_feel_do_engine/participants/lessons_controller.rb
think_feel_do_engine-3.22.8 app/controllers/think_feel_do_engine/participants/lessons_controller.rb
think_feel_do_engine-3.22.7 app/controllers/think_feel_do_engine/participants/lessons_controller.rb
think_feel_do_engine-3.22.6 app/controllers/think_feel_do_engine/participants/lessons_controller.rb
think_feel_do_engine-3.22.5 app/controllers/think_feel_do_engine/participants/lessons_controller.rb
think_feel_do_engine-3.22.4 app/controllers/think_feel_do_engine/participants/lessons_controller.rb
think_feel_do_engine-3.22.2 app/controllers/think_feel_do_engine/participants/lessons_controller.rb
think_feel_do_engine-3.22.1 app/controllers/think_feel_do_engine/participants/lessons_controller.rb
think_feel_do_engine-3.22.0 app/controllers/think_feel_do_engine/participants/lessons_controller.rb
think_feel_do_engine-3.21.2 app/controllers/think_feel_do_engine/participants/lessons_controller.rb
think_feel_do_engine-3.21.1 app/controllers/think_feel_do_engine/participants/lessons_controller.rb
think_feel_do_engine-3.21.0 app/controllers/think_feel_do_engine/participants/lessons_controller.rb
think_feel_do_engine-3.20.1 app/controllers/think_feel_do_engine/participants/lessons_controller.rb