fixes #1829
This commit is contained in:
@@ -9,12 +9,17 @@ class PostsController < ApplicationController
|
|||||||
rescue_from ActiveRecord::RecordNotFound, :with => :rescue_exception
|
rescue_from ActiveRecord::RecordNotFound, :with => :rescue_exception
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@post_set = PostSets::Post.new(tag_query, params[:page], params[:limit] || CurrentUser.user.per_page, params[:raw])
|
if params[:md5].present?
|
||||||
@posts = @post_set.posts
|
@post = Post.find_by_md5(params[:md5])
|
||||||
respond_with(@posts) do |format|
|
redirect_to post_path(@post)
|
||||||
format.atom
|
else
|
||||||
format.xml do
|
@post_set = PostSets::Post.new(tag_query, params[:page], params[:limit] || CurrentUser.user.per_page, params[:raw])
|
||||||
render :xml => @posts.to_xml(:root => "posts")
|
@posts = @post_set.posts
|
||||||
|
respond_with(@posts) do |format|
|
||||||
|
format.atom
|
||||||
|
format.xml do
|
||||||
|
render :xml => @posts.to_xml(:root => "posts")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -309,6 +309,7 @@ Danbooru::Application.routes.draw do
|
|||||||
match "/post/popular_by_month" => redirect("/explore/posts/popular")
|
match "/post/popular_by_month" => redirect("/explore/posts/popular")
|
||||||
match "/post/show/:id/:tag_title" => redirect("/posts/%{id}")
|
match "/post/show/:id/:tag_title" => redirect("/posts/%{id}")
|
||||||
match "/post/show/:id" => redirect("/posts/%{id}")
|
match "/post/show/:id" => redirect("/posts/%{id}")
|
||||||
|
match "/post/show" => redirect {|params, req| "/posts?md5=#{req.params[:md5]}"}
|
||||||
match "/post/view/:id/:tag_title" => redirect("/posts/%{id}")
|
match "/post/view/:id/:tag_title" => redirect("/posts/%{id}")
|
||||||
match "/post/view/:id" => redirect("/posts/%{id}")
|
match "/post/view/:id" => redirect("/posts/%{id}")
|
||||||
match "/post/flag/:id" => redirect("/posts/%{id}")
|
match "/post/flag/:id" => redirect("/posts/%{id}")
|
||||||
|
|||||||
Reference in New Issue
Block a user