Sha256: e1b26af3bf56f9745d68544e11f0190e463ed9cc8d3960bfc62799da8f5ace00
Contents?: true
Size: 1.08 KB
Versions: 4
Compression:
Stored size: 1.08 KB
Contents
# frozen_string_literal: true require_dependency "think_feel_do_engine/application_controller" module ThinkFeelDoEngine module Coach # Enables viewing of an individual message sent by coaches. class SentMessagesController < ApplicationController before_action :authenticate_user!, :set_group def show @sent_message = current_user.sent_messages.find(params[:id]) authorize! :show, @sent_message render( template: "think_feel_do_engine/messages/show", locals: { message: @sent_message, compose_path: new_coach_group_message_path(@group) } ) rescue ActiveRecord::RecordNotFound redirect_to coach_group_messages_url(@group), alert: "Unable to find Message with id #{params[:id]}" end private def set_group @group = Group.find(params[:group_id]) rescue ActiveRecord::RecordNotFound redirect_to main_app.root_url, alert: "Unable to find Group with id #{params[:group_id]}" end end end end
Version data entries
4 entries across 4 versions & 1 rubygems