fix for ads

This commit is contained in:
albert
2013-02-22 21:42:50 -05:00
parent 38f75961f6
commit c0257916b4
4 changed files with 8 additions and 3 deletions

View File

@@ -16,6 +16,10 @@ class CommentsController < ApplicationController
def search
end
def new
redirect_to comments_path
end
def update
@comment = Comment.find(params[:id])
check_privilege(@comment)

View File

@@ -14,7 +14,7 @@ class PostsController < ApplicationController
rescue ::ActiveRecord::StatementInvalid => e
if e.to_s =~ /statement timeout/
@error_message = "The database timed out running your query. Try a simpler query that returns fewer results."
render :action => "error"
render :template => "static/error", :status => 500
else
raise
end
@@ -34,7 +34,7 @@ class PostsController < ApplicationController
format.html do
if @post.errors.any?
@error_message = @post.errors.full_messages.join("; ")
render :action => "error"
render :template => "static/error", :status => 500
else
redirect_to post_path(@post)
end

View File

@@ -13,7 +13,6 @@ module AdvertisementsHelper
:height => @advertisement.height
),
advertisement_hits_path(:advertisement_id => @advertisement.id),
:remote => true,
:method => :post
),
:style => "margin-bottom: 1em;"

View File

@@ -201,7 +201,9 @@ Danbooru::Application.routes.draw do
match "/artist/show" => redirect {|params, req| "/artists?name=#{CGI::escape(req.params[:name])}"}
match "/artist/history/:id" => redirect("/artist_versions?search[artist_id]=%{id}")
match "/artist/update/:id" => redirect("/artists/%{id}")
match "/artist/destroy/:id" => redirect("/artists/%{id}")
match "/artist/recent_changes" => redirect("/artist_versions")
match "/artist/create" => redirect("/artists")
match "/comment" => redirect {|params, req| "/comments?page=#{req.params[:page]}"}
match "/comment/index" => redirect {|params, req| "/comments?page=#{req.params[:page]}"}