Class: ThinkFeelDoEngine::Coach::SiteMessagesController
Overview
Manage messages from the site to Participants.
Constant Summary
ApplicationController::CSRF_COOKIE_NAME, ApplicationController::CSRF_HEADER_NAME, ApplicationController::INACTIVE_MESSAGE, ApplicationController::ROOT_URI
Instance Method Summary
collapse
#access_denied_resource_path, #after_sign_in_path_for, #after_sign_out_path_for
Instance Method Details
#create ⇒ Object
25
26
27
28
29
30
31
32
33
34
|
# File 'app/controllers/think_feel_do_engine/coach/site_messages_controller.rb', line 25
def create
if @site_message.save
SiteMessageMailer.general(@site_message).deliver
redirect_to coach_group_site_message_path(@group, @site_message),
notice: "Site message was successfully created."
else
render :new
end
end
|
#index ⇒ Object
10
11
12
13
14
15
16
|
# File 'app/controllers/think_feel_do_engine/coach/site_messages_controller.rb', line 10
def index
authorize! :index, SiteMessage
participant_ids = current_user.participants_for_group(@group).ids
@site_messages =
SiteMessage
.where(participant_id: participant_ids)
end
|
#new ⇒ Object
21
22
23
|
# File 'app/controllers/think_feel_do_engine/coach/site_messages_controller.rb', line 21
def new
@participants = current_user.participants_for_group(@group)
end
|
#show ⇒ Object
18
19
|
# File 'app/controllers/think_feel_do_engine/coach/site_messages_controller.rb', line 18
def show
end
|