Sha256: 38b0bc0d52b922832485239e7f710751d3db3c97283e3572882521d368065454

Contents?: true

Size: 709 Bytes

Versions: 4

Compression:

Stored size: 709 Bytes

Contents

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

4 entries across 4 versions & 1 rubygems

Version Path
think_feel_do_engine-3.10.9 app/controllers/think_feel_do_engine/participants/lessons_controller.rb
think_feel_do_engine-3.10.8 app/controllers/think_feel_do_engine/participants/lessons_controller.rb
think_feel_do_engine-3.10.7 app/controllers/think_feel_do_engine/participants/lessons_controller.rb
think_feel_do_engine-3.10.6 app/controllers/think_feel_do_engine/participants/lessons_controller.rb