fix editing a note from the notes page

This commit is contained in:
Reinier Balt 2010-11-19 22:45:18 +01:00
parent 77e2ff0751
commit 94b5aa2346
10 changed files with 133 additions and 61 deletions

View file

@ -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