work on note views

This commit is contained in:
albert
2011-01-19 14:28:22 -05:00
parent 0224c41252
commit a6dfd4f0f5
57 changed files with 104563 additions and 15 deletions

View File

@@ -1,16 +1,39 @@
class NotesController < ApplicationController
respond_to :html, :xml, :json
before_filter :member_only, :except => [:index, :show]
def index
@search = Note.search(params[:search])
@notes = @search.paginate(:page => params[:page])
respond_with(@notes)
end
def show
@note = Note.find(params[:id])
respond_with(@note)
end
def create
@note = Note.create(params[:note])
respond_with(@note)
end
def update
@note = Note.find(params[:id])
@note.update_attributes(params[:note])
respond_with(@note)
end
def destroy
@note = Note.find(params[:id])
@note.destroy
respond_with(@note)
end
def revert
@note = Note.find(params[:id])
@version = NoteVersion.find(params[:version_id])
@note.revert_to(@version)
respond_with(@note)
end
end