Kill trailing whitespace in ruby files
This commit is contained in:
@@ -3,7 +3,7 @@ class CommentsController < ApplicationController
|
||||
before_filter :member_only, :only => [:update, :create, :edit, :destroy]
|
||||
rescue_from User::PrivilegeError, :with => "static/access_denied"
|
||||
rescue_from ActiveRecord::StatementInvalid, :with => :search_error
|
||||
|
||||
|
||||
def index
|
||||
if params[:group_by] == "comment"
|
||||
index_by_comment
|
||||
@@ -13,21 +13,21 @@ class CommentsController < ApplicationController
|
||||
index_by_post
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def search
|
||||
end
|
||||
|
||||
|
||||
def new
|
||||
redirect_to comments_path
|
||||
end
|
||||
|
||||
|
||||
def update
|
||||
@comment = Comment.find(params[:id])
|
||||
check_privilege(@comment)
|
||||
@comment.update_attributes(params[:comment])
|
||||
respond_with(@comment, :location => post_path(@comment.post_id))
|
||||
end
|
||||
|
||||
|
||||
def create
|
||||
@comment = Comment.create(params[:comment])
|
||||
respond_with(@comment) do |format|
|
||||
@@ -40,20 +40,20 @@ class CommentsController < ApplicationController
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def edit
|
||||
@comment = Comment.find(params[:id])
|
||||
check_privilege(@comment)
|
||||
respond_with(@comment)
|
||||
end
|
||||
|
||||
|
||||
def show
|
||||
@comment = Comment.find(params[:id])
|
||||
respond_with(@comment) do |format|
|
||||
format.json {render :json => @comment.to_json(:methods => [:creator_name])}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def destroy
|
||||
@comment = Comment.find(params[:id])
|
||||
check_privilege(@comment)
|
||||
@@ -62,7 +62,7 @@ class CommentsController < ApplicationController
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
def index_for_post
|
||||
@post = Post.find(params[:post_id])
|
||||
@@ -78,14 +78,14 @@ private
|
||||
format.html {render :action => "index_by_post"}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def index_by_comment
|
||||
@comments = Comment.search(params[:search]).order("comments.id DESC").paginate(params[:page], :search_count => params[:search])
|
||||
respond_with(@comments) do |format|
|
||||
format.html {render :action => "index_by_comment"}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def check_privilege(comment)
|
||||
if !comment.editable_by?(CurrentUser.user)
|
||||
raise User::PrivilegeError
|
||||
@@ -93,7 +93,7 @@ private
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
|
||||
def search_error(e)
|
||||
if e.message =~ /syntax error in tsquery/
|
||||
@error_message = "Meta-tags are not supported in comment searches by tag"
|
||||
|
||||
Reference in New Issue
Block a user