fixes #1108
This commit is contained in:
@@ -3,6 +3,10 @@ class ArtistVersionsController < ApplicationController
|
||||
|
||||
def index
|
||||
@artist_versions = ArtistVersion.search(params[:search]).order("id desc").paginate(params[:page], :search_count => params[:search])
|
||||
respond_with(@artist_versions)
|
||||
respond_with(@artist_versions) do |format|
|
||||
format.xml do
|
||||
render :xml => @artist_versions.to_xml(:root => "artist-versions")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -28,7 +28,7 @@ class ArtistsController < ApplicationController
|
||||
@artists = Artist.search(params[:search] || params).order("id desc").paginate(params[:page])
|
||||
respond_with(@artists) do |format|
|
||||
format.xml do
|
||||
render :xml => @artists.to_xml(:include => [:urls])
|
||||
render :xml => @artists.to_xml(:include => [:urls], :root => "artists")
|
||||
end
|
||||
format.json do
|
||||
render :json => @artists.to_json(:include => [:urls])
|
||||
|
||||
@@ -76,6 +76,9 @@ private
|
||||
@posts.all
|
||||
respond_with(@posts) do |format|
|
||||
format.html {render :action => "index_by_post"}
|
||||
format.xml do
|
||||
render :xml => @posts.to_xml(:root => "posts")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -83,6 +86,9 @@ private
|
||||
@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"}
|
||||
format.xml do
|
||||
render :xml => @comments.to_xml(:root => "comments")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -16,7 +16,11 @@ class DmailsController < ApplicationController
|
||||
def index
|
||||
@search = Dmail.visible.search(params[:search])
|
||||
@dmails = @search.order("dmails.created_at desc").paginate(params[:page])
|
||||
respond_with(@dmails)
|
||||
respond_with(@dmails) do |format|
|
||||
format.xml do
|
||||
render :xml => @dmails.to_xml(:root => "dmails")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def search
|
||||
|
||||
@@ -18,7 +18,11 @@ class ForumPostsController < ApplicationController
|
||||
def index
|
||||
@search = ForumPost.active.search(params[:search])
|
||||
@forum_posts = @search.order("forum_posts.id DESC").paginate(params[:page], :search_count => params[:search])
|
||||
respond_with(@forum_posts)
|
||||
respond_with(@forum_posts) do |format|
|
||||
format.xml do
|
||||
render :xml => @forum_posts.to_xml(:root => "forum-posts")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def search
|
||||
|
||||
@@ -20,7 +20,11 @@ class ForumTopicsController < ApplicationController
|
||||
def index
|
||||
@search = ForumTopic.active.search(params[:search])
|
||||
@forum_topics = @search.order("is_sticky DESC, updated_at DESC").paginate(params[:page], :search_count => params[:search])
|
||||
respond_with(@forum_topics)
|
||||
respond_with(@forum_topics) do |format|
|
||||
format.xml do
|
||||
render :xml => @forum_topics.to_xml(:root => "forum-topics")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
@@ -5,6 +5,10 @@ class NoteVersionsController < ApplicationController
|
||||
def index
|
||||
@search = NoteVersion.search(params[:search])
|
||||
@note_versions = @search.order("note_versions.id desc").paginate(params[:page])
|
||||
respond_with(@note_versions)
|
||||
respond_with(@note_versions) do |format|
|
||||
format.xml do
|
||||
render :xml => @note_versions.to_xml(:root => "note-versions")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -59,6 +59,9 @@ private
|
||||
@posts = @post_set.posts
|
||||
respond_with(@posts) do |format|
|
||||
format.html {render :action => "index_by_post"}
|
||||
format.xml do
|
||||
render :xml => @posts.to_xml(:root => "posts")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -66,6 +69,9 @@ private
|
||||
@notes = Note.search(params[:search]).order("id desc").paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
|
||||
respond_with(@notes) do |format|
|
||||
format.html {render :action => "index_by_note"}
|
||||
format.xml do
|
||||
render :xml => @notes.to_xml(:root => "notes")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,9 +1,16 @@
|
||||
class PoolVersionsController < ApplicationController
|
||||
respond_to :html, :xml, :js
|
||||
|
||||
def index
|
||||
if params[:search] && params[:search][:pool_id]
|
||||
@pool = Pool.find(params[:search][:pool_id])
|
||||
end
|
||||
|
||||
@pool_versions = PoolVersion.search(params[:search]).order("updated_at desc").paginate(params[:page], :search_count => params[:search])
|
||||
respond_with(@pool_versions) do |format|
|
||||
format.xml do
|
||||
render :xml => @pool_versions.to_xml(:root => "pool-versions")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -16,7 +16,11 @@ class PoolsController < ApplicationController
|
||||
|
||||
def index
|
||||
@pools = Pool.active.search(params[:search]).order("updated_at desc").paginate(params[:page], :search_count => params[:search])
|
||||
respond_with(@pools)
|
||||
respond_with(@pools) do |format|
|
||||
format.xml do
|
||||
render :xml => @pools.to_xml(:root => "pools")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def search
|
||||
|
||||
@@ -11,6 +11,11 @@ class PostAppealsController < ApplicationController
|
||||
def index
|
||||
@search = PostAppeal.order("id desc").search(params[:search])
|
||||
@post_appeals = @search.paginate(params[:page])
|
||||
respond_with(@post_appeals) do |format|
|
||||
format.xml do
|
||||
render :xml => @post_appeals.to_xml(:root => "post-appeals")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
@@ -11,6 +11,11 @@ class PostFlagsController < ApplicationController
|
||||
def index
|
||||
@search = PostFlag.order("id desc").search(params[:search])
|
||||
@post_flags = @search.paginate(params[:page])
|
||||
respond_with(@post_flags) do |format|
|
||||
format.xml do
|
||||
render :xml => @post_flags.to_xml(:root => "post-flags")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
@@ -4,7 +4,11 @@ class PostVersionsController < ApplicationController
|
||||
|
||||
def index
|
||||
@post_versions = PostVersion.search(params[:search]).order("updated_at desc").paginate(params[:page], :search_count => params[:search])
|
||||
respond_with(@post_versions)
|
||||
respond_with(@post_versions) do |format|
|
||||
format.xml do
|
||||
render :xml => @post_versions.to_xml(:root => "post-versions")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def search
|
||||
|
||||
@@ -12,6 +12,9 @@ class PostsController < ApplicationController
|
||||
@posts = @post_set.posts
|
||||
respond_with(@posts) do |format|
|
||||
format.atom
|
||||
format.xml do
|
||||
render :xml => @posts.to_xml(:root => "posts")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -18,7 +18,11 @@ class TagAliasesController < ApplicationController
|
||||
def index
|
||||
@search = TagAlias.search(params[:search])
|
||||
@tag_aliases = @search.order("(case status when 'pending' then 0 when 'queued' then 1 else 2 end), antecedent_name, consequent_name").paginate(params[:page])
|
||||
respond_with(@tag_aliases)
|
||||
respond_with(@tag_aliases) do |format|
|
||||
format.xml do
|
||||
render :xml => @tag_aliases.to_xml(:root => "tag-aliases")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
@@ -10,7 +10,11 @@ class TagImplicationsController < ApplicationController
|
||||
def index
|
||||
@search = TagImplication.search(params[:search])
|
||||
@tag_implications = @search.order("(case status when 'pending' then 0 when 'queued' then 1 else 2 end), antecedent_name, consequent_name").paginate(params[:page])
|
||||
respond_with(@tag_implications)
|
||||
respond_with(@tag_implications) do |format|
|
||||
format.xml do
|
||||
render :xml => @tag_implications.to_xml(:root => "tag-implications")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
@@ -9,7 +9,11 @@ class TagsController < ApplicationController
|
||||
|
||||
def index
|
||||
@tags = Tag.search(params[:search]).paginate(params[:page], :search_count => params[:search])
|
||||
respond_with(@tags)
|
||||
respond_with(@tags) do |format|
|
||||
format.xml do
|
||||
render :xml => @tags.to_xml(:root => "tags")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def search
|
||||
|
||||
@@ -19,7 +19,11 @@ class UploadsController < ApplicationController
|
||||
def index
|
||||
@search = Upload.search(params[:search])
|
||||
@uploads = @search.order("id desc").paginate(params[:page])
|
||||
respond_with(@uploads)
|
||||
respond_with(@uploads) do |format|
|
||||
format.xml do
|
||||
render :xml => @uploads.to_xml(:root => "uploads")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
@@ -22,7 +22,11 @@ class UserFeedbacksController < ApplicationController
|
||||
def index
|
||||
@search = UserFeedback.search(params[:search])
|
||||
@user_feedbacks = @search.paginate(params[:page]).order("created_at desc")
|
||||
respond_with(@user_feedbacks)
|
||||
respond_with(@user_feedbacks) do |format|
|
||||
format.xml do
|
||||
render :xml => @user_feedbacks.to_xml(:root => "user-feedbacks")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def create
|
||||
|
||||
@@ -16,7 +16,11 @@ class UsersController < ApplicationController
|
||||
|
||||
def index
|
||||
@users = User.search(params[:search]).order("users.id desc").paginate(params[:page], :search_count => params[:search])
|
||||
respond_with(@users)
|
||||
respond_with(@users) do |format|
|
||||
format.xml do
|
||||
render :xml => @users.to_xml(:root => "users")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def search
|
||||
|
||||
@@ -3,7 +3,11 @@ class WikiPageVersionsController < ApplicationController
|
||||
|
||||
def index
|
||||
@wiki_page_versions = WikiPageVersion.search(params[:search]).order("id desc").paginate(params[:page], :search_count => params[:search])
|
||||
respond_with(@wiki_page_versions)
|
||||
respond_with(@wiki_page_versions) do |format|
|
||||
format.xml do
|
||||
render :xml => @wiki_page_versions.to_xml(:root => "wiki-page-versions")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
@@ -23,6 +23,9 @@ class WikiPagesController < ApplicationController
|
||||
redirect_to(wiki_page_path(@wiki_pages.first))
|
||||
end
|
||||
end
|
||||
format.xml do
|
||||
render :xml => @wiki_pages.to_xml(:root => "wiki-pages")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user