Class: ThinkFeelDoEngine::Coach::ReceivedMessagesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/think_feel_do_engine/coach/received_messages_controller.rb

Overview

Enables viewing of messages sent to coaches.

Constant Summary

Constants inherited from ApplicationController

ApplicationController::CSRF_COOKIE_NAME, ApplicationController::CSRF_HEADER_NAME, ApplicationController::INACTIVE_MESSAGE, ApplicationController::ROOT_URI

Instance Method Summary collapse

Methods inherited from ApplicationController

#access_denied_resource_path, #after_sign_in_path_for, #after_sign_out_path_for, #raise_not_found!, #render_not_found

Instance Method Details

#showObject



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/think_feel_do_engine/coach/received_messages_controller.rb', line 12

def show
  @received_message = current_user.received_messages.find(params[:id])
  authorize! :show, @received_message
  @received_message.try(:mark_read)
  render(
    template: "think_feel_do_engine/messages/show",
    locals: {
      message: @received_message,
      compose_path: new_coach_group_message_path(@group),
      reply_path: reply_path(@received_message)
    }
  )
end