Add /post_replacements.json, /posts/1234/replacements.json.

This commit is contained in:
evazion
2017-05-14 18:49:57 -05:00
parent 78b08d8394
commit cb09b6661d
5 changed files with 68 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
class PostReplacementsController < ApplicationController
respond_to :html, :xml, :json
before_filter :approver_only, except: [:index]
def index
params[:search][:post_id] = params.delete(:post_id) if params.has_key?(:post_id)
@post_replacements = PostReplacement.search(params[:search]).paginate(params[:page], limit: params[:limit])
respond_with(@post_replacements)
end
end