Method: NotesController#update

Defined in:
lib/generators/jinda/templates/app/controllers/jinda_org/notes_controller.rb

#updateObject



39
40
41
42
43
44
45
46
47
48
49
# File 'lib/generators/jinda/templates/app/controllers/jinda_org/notes_controller.rb', line 39

def update
  # $xvars["select_note"] and $xvars["edit_note"]
  # These are variables.
  # They contain everything that we get their forms select_note and edit_note
  note_id = $xvars["select_note"] ? $xvars["select_note"]["id"] : $xvars["p"]["note_id"]
  @note = Note.find(note_id)
  @note.update(title: $xvars["edit_note"]["title"],
               body: $xvars["edit_note"]["body"])
  redirect_to @note

end