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

View File

@@ -19,6 +19,10 @@ class PoolsController < ApplicationController
respond_with(@pools)
end
def search
@search = Pool.search(params[:search])
end
def show
@pool = Pool.find(params[:id])
@post_set = PostSets::Pool.new(@pool, :page => params[:page])

View File

@@ -1,2 +1,4 @@
class StaticController < ApplicationController
def jquery_test
end
end

View File

@@ -27,6 +27,8 @@ class UsersController < ApplicationController
def create
@user = User.create(params[:user])
session[:user_id] = @user.id
set_current_user
respond_with(@user)
end