1
0
Fork 0
dokkan-data-rails/app/controllers/admin/evidences_controller.rb

34 lines
597 B
Ruby
Raw Normal View History

2015-10-14 11:24:15 -04:00
class Admin::EvidencesController < Admin::BaseController
def index
@evidences = Evidence.all
end
def new
@evidence = Evidence.new
end
def create
@evidence = Evidence.new(evidence_params)
if @evidence.save
redirect_to admin_evidences_path, notice: 'Evidence was created'
else
render :new
end
end
def destroy
@evidence = Evidence.find(params[:id])
@evidence.destroy
redirect_to admin_evidences_path, notice: 'Evidence was deleted'
end
private
def evidence_params
params.require(:evidence).permit(:screenshot)
end
end