Sha256: 566661ac2af9fe83f0fafa095c6d6f06bbb6d47876e59556b859de856abbf6af

Contents?: true

Size: 1.1 KB

Versions: 18

Compression:

Stored size: 1.1 KB

Contents

require_dependency "think_feel_do_engine/application_controller"

module ThinkFeelDoEngine
  module Coach
    # Present Participant Activities Visualization to the Coach.
    class ParticipantActivitiesVisualizationsController < ApplicationController
      before_action :authenticate_user!
      rescue_from ActiveRecord::RecordNotFound, with: :record_not_found

      RenderOptions = Struct.new(
        :view_context, :app_context, :position, :participant
      )

      def show
        @participant = Participant.find(params[:participant_id])
        @group = @participant.groups.find(params[:group_id])
        provider = ContentProviders::YourActivitiesProvider.new
        options = RenderOptions.new(
          self,
          @participant.navigation_status,
          @participant.navigation_status.content_position,
          @participant
        )
        provider.render_current(options)
      end

      def record_not_found
        redirect_to main_app.root_path,
                    alert: "The activities visualization you were "\
                    "looking does not exist."
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

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