Interface for reviewing queued posts

This commit is contained in:
Robin Ward
2015-04-10 17:00:50 -04:00
parent f1ede42569
commit 96d2c5069b
21 changed files with 219 additions and 17 deletions

View File

@ -0,0 +1,20 @@
require_dependency 'queued_post_serializer'
class QueuedPostsController < ApplicationController
before_filter :ensure_staff
def index
state = QueuedPost.states[(params[:state] || 'new').to_sym]
state ||= QueuedPost.states[:new]
@queued_posts = QueuedPost.where(state: state)
render_serialized(@queued_posts, QueuedPostSerializer, root: :queued_posts)
end
def update
qp = QueuedPost.where(id: params[:id]).first
render_serialized(qp, QueuedPostSerializer, root: :queued_posts)
end
end