This commit is contained in:
Toks
2013-07-05 10:33:54 -04:00
parent 3d522aaf4a
commit afdc61c31a
2 changed files with 12 additions and 6 deletions

View File

@@ -9,12 +9,17 @@ class PostsController < ApplicationController
rescue_from ActiveRecord::RecordNotFound, :with => :rescue_exception
def index
@post_set = PostSets::Post.new(tag_query, params[:page], params[:limit] || CurrentUser.user.per_page, params[:raw])
@posts = @post_set.posts
respond_with(@posts) do |format|
format.atom
format.xml do
render :xml => @posts.to_xml(:root => "posts")
if params[:md5].present?
@post = Post.find_by_md5(params[:md5])
redirect_to post_path(@post)
else
@post_set = PostSets::Post.new(tag_query, params[:page], params[:limit] || CurrentUser.user.per_page, params[:raw])
@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