From c0257916b49f4dc4fb7059e37b37481a25e39f33 Mon Sep 17 00:00:00 2001 From: albert Date: Fri, 22 Feb 2013 21:42:50 -0500 Subject: [PATCH] fix for ads --- app/controllers/comments_controller.rb | 4 ++++ app/controllers/posts_controller.rb | 4 ++-- app/helpers/advertisements_helper.rb | 1 - config/routes.rb | 2 ++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 350e7881a..00d858b31 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -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) diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 3fd329fce..fa96fc058 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -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 diff --git a/app/helpers/advertisements_helper.rb b/app/helpers/advertisements_helper.rb index 221daef54..8047fd686 100644 --- a/app/helpers/advertisements_helper.rb +++ b/app/helpers/advertisements_helper.rb @@ -13,7 +13,6 @@ module AdvertisementsHelper :height => @advertisement.height ), advertisement_hits_path(:advertisement_id => @advertisement.id), - :remote => true, :method => :post ), :style => "margin-bottom: 1em;" diff --git a/config/routes.rb b/config/routes.rb index 3b6ce5071..6d8c3c53d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -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]}"}