1
0
Fork 0
forked from OpenNeo/impress
impress/app/controllers/broken_image_reports_controller.rb
2015-05-03 16:57:42 -05:00

22 lines
689 B
Ruby

class BrokenImageReportsController < ApplicationController
def new
@swf_assets = SwfAsset.from_wardrobe_link_params(params[:asset_ids]).where(:has_image => true)
end
def create
swf_asset = SwfAsset.where(:type => params[:swf_asset_type]).
find_by_remote_id(params[:swf_asset_remote_id])
if swf_asset.image_manual?
flash[:warning] = t('broken_image_reports.create.manual')
else
# If the asset is already reported as broken, no need to shout about it.
# Just don't enqueue it, thank the user, and move on.
swf_asset.report_broken
flash[:success] = t('broken_image_reports.create.success')
end
redirect_to :back
end
end