fixed comment test

This commit is contained in:
albert
2011-05-16 09:27:06 -04:00
parent 903a3fa5d1
commit 158810d9f0
20 changed files with 174 additions and 58 deletions

View File

@@ -3,9 +3,11 @@ class NotesController < ApplicationController
before_filter :member_only, :except => [:index, :show]
def index
@search = Note.search(params[:search])
@notes = @search.paginate(:page => params[:page])
respond_with(@notes)
if params[:group_by] == "post"
index_by_post
else
index_by_note
end
end
def show
@@ -36,4 +38,21 @@ class NotesController < ApplicationController
@note.revert_to!(@version)
respond_with(@note)
end
private
def index_by_post
@posts = Post.tag_match(params[:tags]).noted_before(params[:before_date] || Time.now).limit(8)
respond_with(@posts) do |format|
format.html {render :action => "index_by_post"}
end
end
def index_by_note
@search = Note.search(params[:search])
@notes = @search.paginate(:page => params[:page])
respond_with(@notes) do |format|
format.html {render :action => "index_by_note"}
end
end
end