Uploading screenshots really works finally. :)
This commit is contained in:
parent
18edade734
commit
60a183576c
2 changed files with 9 additions and 10 deletions
|
|
@ -58,7 +58,7 @@ class PackagesController < ApplicationController
|
|||
# TODO
|
||||
raise "name not given" unless params[:name]
|
||||
@package = Package.find_by(name: params[:name])
|
||||
@new_screenshot = @package.screenshots.new
|
||||
#@new_screenshot = @package.screenshots.new
|
||||
end
|
||||
|
||||
def upload_image
|
||||
|
|
@ -66,7 +66,6 @@ class PackagesController < ApplicationController
|
|||
#render text: params.to_json
|
||||
@package = Package.find_by(name: params[:name])
|
||||
@new_screenshot = @package.screenshots.create(image: params[:image])
|
||||
@new_screenshot.save
|
||||
#raise
|
||||
#@package.save
|
||||
#new_screenshot.image = params[:image]
|
||||
|
|
|
|||
|
|
@ -21,15 +21,15 @@
|
|||
' Click or drag a PNG screenshot file here
|
||||
.small-6.columns
|
||||
' Form
|
||||
- for screenshot in @package.screenshots
|
||||
.row
|
||||
img src=screenshot.url('large')
|
||||
|
||||
- puts @package.screenshots
|
||||
- @package.screenshots.each do |screenshot|
|
||||
.listview
|
||||
a.black.fancybox href=screenshot.image.url(:large, timestamp: false) rel='fancybox-thumb' title=screenshot.caption
|
||||
= image_tag(screenshot.image.url(:large, timestamp: false), alt: screenshot.caption)
|
||||
.row
|
||||
h1 =screenshot.package.name
|
||||
img src=screenshot.image.url(:large, timestamp: false, alt: screenshot.caption)
|
||||
|
||||
// - @package.screenshots.each do |screenshot|
|
||||
// .listview
|
||||
// a.black.fancybox href=screenshot.image.url(:large, timestamp: false) rel='fancybox-thumb' title=screenshot.caption
|
||||
// = image_tag(screenshot.image.url(:large, timestamp: false), alt: screenshot.caption)
|
||||
// .imgcaption
|
||||
// => screenshot.caption
|
||||
// - if screenshot.uploader
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue