mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-24 03:00:12 +01:00
fix editing a note from the notes page
This commit is contained in:
parent
77e2ff0751
commit
94b5aa2346
10 changed files with 133 additions and 61 deletions
|
|
@ -63,13 +63,12 @@ class NotesController < ApplicationController
|
|||
end
|
||||
|
||||
def update
|
||||
note = current_user.notes.find(params['id'])
|
||||
note.attributes = params["note"]
|
||||
if note.save
|
||||
render :partial => 'notes', :object => note
|
||||
else
|
||||
notify :warning, "Couldn't update note \"#{note.id}\""
|
||||
render :text => ''
|
||||
@note = current_user.notes.find(params['id'])
|
||||
@note.attributes = params["note"]
|
||||
@saved = @note.save
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue