Class: Gaku::NotesController

Inherits:
GakuController show all
Defined in:
app/controllers/gaku/notes_controller.rb

Instance Method Summary collapse

Methods inherited from GakuController

#resolve_layout

Instance Method Details

#createObject



20
21
22
23
24
25
# File 'app/controllers/gaku/notes_controller.rb', line 20

def create
  @note = @notable.notes.new(note_params)
  @note.save
  set_count
  respond_with @note
end

#destroyObject



38
39
40
41
42
# File 'app/controllers/gaku/notes_controller.rb', line 38

def destroy
  @note.destroy
  set_count
  respond_with @note
end

#editObject



27
28
# File 'app/controllers/gaku/notes_controller.rb', line 27

def edit
end

#indexObject



10
11
12
13
# File 'app/controllers/gaku/notes_controller.rb', line 10

def index
  @notes = @notable.notes
  respond_with @notes
end

#newObject



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

def new
  @note = Note.new
  respond_with @note
end

#showObject



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

def show
end

#updateObject



33
34
35
36
# File 'app/controllers/gaku/notes_controller.rb', line 33

def update
  @note.update(note_params)
  respond_with @note
end