Skip to content

Commit

Permalink
don't require a $ for the {filename} interpolation
Browse files Browse the repository at this point in the history
This is more consistent with the other variables.

I started using ${cleaned_filename} and I noticed I was always getting a
$ at the front of my filenames, which led me to discover that actually
{cleaned_filename} was being used in the regex, not ${cleaned_filename}.

I think its probably easier to just be consistent for all the variables
and don't require a $.
  • Loading branch information
mcfiredrill committed Jan 19, 2016
1 parent b36ad83 commit 2ec16fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/assets/javascripts/s3_direct_upload.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ $.fn.S3Uploader = (options) ->
else # IE <= 9 retu rn a null result object so we use the file object instead
domain = $uploadForm.find('input[type=file]').data('url')
key = $uploadForm.find('input[name=key]').val()
content.filepath = key.replace('/${filename}', '').replace('/{cleaned_filename}', '')
content.url = domain + key.replace('/${filename}', encodeURIComponent(file.name))
content.filepath = key.replace('/{filename}', '').replace('/{cleaned_filename}', '')
content.url = domain + key.replace('/{filename}', encodeURIComponent(file.name))
content.url = content.url.replace('/{cleaned_filename}', cleaned_filename(file.name))

content.filename = file.name
Expand Down

0 comments on commit 2ec16fb

Please sign in to comment.