TODOs added
This commit is contained in:
parent
3d297b0cb6
commit
86e0a62c24
2 changed files with 4 additions and 0 deletions
|
|
@ -55,6 +55,8 @@ class PackagesController < ApplicationController
|
|||
@package = Package.find_by(name: params[:name])
|
||||
params[:screenshot][:image].each do |img|
|
||||
@package.screenshots.create(image: img)
|
||||
# TODO: add logging
|
||||
# TODO: what do we do if the user uploads an invalid image? tell them?
|
||||
end
|
||||
|
||||
redirect_to package_path
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@ class Screenshot < ActiveRecord::Base
|
|||
#path: ':rails_root/public/system/:class/:attachment/:id_partition/:style/:filename',
|
||||
path: ':rails_root/public/screenshots/:id_partition/:style.png',
|
||||
url: '/screenshots/:id_partition/:style.png',
|
||||
# TODO: Make hash_secret configurable in the main configuration.
|
||||
# Do not check it into Git.
|
||||
hash_secret: 'M4xGM9v6y17Y27sZ1liWrnQaXdX4YDdZCJ7fOqcAUg3cZJqK9x'
|
||||
validates_attachment_content_type :image, :content_type => /\Aimage\/png\Z/
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue