fixed comment test
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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])
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
class StaticController < ApplicationController
|
||||
def jquery_test
|
||||
end
|
||||
end
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user