Add more artist commentary API endpoints.
* GET /posts/1/artist_commentary.json * GET /artist_commentaries/1.json
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
class ArtistCommentariesController < ApplicationController
|
||||
respond_to :html, :xml, :json, :js
|
||||
before_filter :member_only, :except => [:index]
|
||||
before_filter :member_only, :except => [:index, :show]
|
||||
|
||||
def index
|
||||
@commentaries = ArtistCommentary.search(params[:search]).order("artist_commentaries.id desc").paginate(params[:page], :limit => params[:limit])
|
||||
@@ -11,6 +11,18 @@ class ArtistCommentariesController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
if params[:id]
|
||||
@commentary = ArtistCommentary.find(params[:id])
|
||||
else
|
||||
@commentary = ArtistCommentary.find_by_post_id!(params[:post_id])
|
||||
end
|
||||
|
||||
respond_with(@commentary) do |format|
|
||||
format.html { redirect_to post_path(@commentary.post) }
|
||||
end
|
||||
end
|
||||
|
||||
def create_or_update
|
||||
@artist_commentary = ArtistCommentary.find_by_post_id(params[:artist_commentary][:post_id])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user