docbrown/app/controllers/moderations_controller.rb
Ben Halpern 6cff2e68d5
Add /mod views (#299)
* Fix boosted issue

* Add /mod views

* Fix format issue

* Remove unnecessary articles controller code
2018-05-09 18:26:36 -04:00

20 lines
415 B
Ruby

class ModerationsController < ApplicationController
before_action :check_trusted
def article
@moderatable = Article.find_by_slug(params[:slug])
render template: "moderations/mod"
end
def comment
@moderatable = Comment.find(params[:id_code].to_i(26))
render template: "moderations/mod"
end
private
def check_trusted
not_found unless current_user&.has_role?(:trusted)
end
end