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

32 lines
604 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
2015-10-16 14:45:17 -04:00
params[:evidence][:screenshot].each do |screenshot|
Evidence.new(screenshot: screenshot).save
2015-10-14 11:24:15 -04:00
end
2015-10-16 14:45:17 -04:00
redirect_to admin_evidences_path, notice: 'Evidence was created'
2015-10-14 11:24:15 -04:00
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