Add artist commentary listing and search

related to #2084, fixes #2085
This commit is contained in:
Toks
2014-03-10 22:56:38 -04:00
parent 424d84661a
commit 2f3f401f3b
10 changed files with 130 additions and 2 deletions

View File

@@ -2,6 +2,15 @@ class ArtistCommentariesController < ApplicationController
respond_to :html, :xml, :json, :js
before_filter :member_only
def index
@commentaries = ArtistCommentary.search(params[:search]).order("artist_commentaries.id desc").paginate(params[:page], :limit => params[:limit])
respond_with(@commentaries) do |format|
format.xml do
render :xml => @commentaries.to_xml(:root => "artist-commentaries")
end
end
end
def create_or_update
@artist_commentary = ArtistCommentary.find_by_post_id(params[:artist_commentary][:post_id])