Added simple feature to remove screenshots

This commit is contained in:
Christoph Haas 2015-02-10 22:23:10 +01:00
parent 60a183576c
commit 65f74e0568
3 changed files with 9 additions and 1 deletions

View file

@ -74,6 +74,13 @@ class PackagesController < ApplicationController
redirect_to upload_package_by_name_path
end
def delete_screenshot
@screenshot = Screenshot.find_by(id: params[:id])
@screenshot.destroy
redirect_to upload_package_by_name_path
end
private
#def user_params

View file

@ -23,8 +23,8 @@
' Form
- @package.screenshots.each do |screenshot|
.row
h1 =screenshot.package.name
img src=screenshot.image.url(:large, timestamp: false, alt: screenshot.caption)
= link_to "Delete screenshot", delete_screenshot_path(@package.name, screenshot.id)
// - @package.screenshots.each do |screenshot|
// .listview