Module: Course::Forum::TopicControllerLockingConcern

Extended by:
ActiveSupport::Concern
Included in:
TopicsController
Defined in:
app/controllers/concerns/course/forum/topic_controller_locking_concern.rb

Instance Method Summary collapse

Instance Method Details

#set_lockedObject


5
6
7
8
9
10
11
12
13
# File 'app/controllers/concerns/course/forum/topic_controller_locking_concern.rb', line 5

def set_locked
  if @topic.update_attributes(locked_params)
    redirect_to course_forum_topic_path(current_course, @forum, @topic),
                success: locked_state_text(true)
  else
    redirect_to course_forum_topic_path(current_course, @forum, @topic),
                danger: locked_state_text(false)
  end
end