Skip to content

Commit

Permalink
Security issue fixed for S3
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil Gehani committed Dec 12, 2013
1 parent 2557bd5 commit 7a30d56
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/pins_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class PinsController < ApplicationController

def index
# With pagination from will_paginate gem
@pins = Pin.all.order("created_at DESC").page(params[:page]).per_page(20)
@pins = Pin.order("created_at DESC").page(params[:page]).per_page(20)
respond_to do |format|
format.html # index.html.erb
#format.json { render json: @pins }
Expand Down
8 changes: 7 additions & 1 deletion lib/tasks/populateimages3.rake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,13 @@ namespace :db do
User.all.each do |user|
puts "[DEBUG] uploading images for user #{user.id} of #{User.last.id}"
10.times do |n|
#image = image_remote_url('https://event_sample_images.s3-website-us-east-1.amazonaws.com').sample
#What I want here is perhaps an array that gets the list of file names
#via a wildcard - basically anything.jpg and puts them in an array
#then use the elements of the array and append to the url - .../sample/blah
#and pop from the array until empty
#example - this link works - https://s3.amazonaws.com/event_sample_images/sample/IMG_0537.jpg
#but the link to just the sample directory does not .../sample
#image_url = 'https://s3.amazonaws.com/event_sample_images/sample/*.jpg'
#description = %w(cool awesome crazy wow adorbs incredible).sample
#user.pins.create!(image: image, description: description)
end
Expand Down

0 comments on commit 7a30d56

Please sign in to comment.