Class: Gaku::StudentSelectionController

Inherits:
GakuController
  • Object
show all
Defined in:
app/controllers/gaku/student_selection_controller.rb

Instance Method Summary collapse

Methods inherited from GakuController

#resolve_layout

Instance Method Details

#addObject



9
10
11
12
# File 'app/controllers/gaku/student_selection_controller.rb', line 9

def add
  @selection = @user_selection.add(@student)
  respond_with @selection
end

#clearObject



34
35
36
37
# File 'app/controllers/gaku/student_selection_controller.rb', line 34

def clear
  @selection = @user_selection.remove_all
  respond_with @selection
end

#collectionObject



20
21
22
23
# File 'app/controllers/gaku/student_selection_controller.rb', line 20

def collection
  @selection = @user_selection.collection(@students)
  render 'index'
end

#indexObject



30
31
32
# File 'app/controllers/gaku/student_selection_controller.rb', line 30

def index
  @selection = @user_selection.students
end

#removeObject



14
15
16
17
18
# File 'app/controllers/gaku/student_selection_controller.rb', line 14

def remove
  @selection = @user_selection.remove(@student)
  set_count
  respond_with @selection
end

#remove_collectionObject



25
26
27
28
# File 'app/controllers/gaku/student_selection_controller.rb', line 25

def remove_collection
  @selection = @user_selection.remove_collection(@students)
  render 'index'
end