I'm getting an error for a bad URI. I'm assuming that the uri is being formed via the S3_uploader function. I'm able to upload to the s3 server but the code stops executing before reaching my view / model and no data is stored in the database. I posted the code from my view and .js file below. I realize that [object%20Object] results from trying to convert {} to a string, but removing these from my code does not change the error message. Could someone please help me learn what the problem is here (where the uri is being formed) and how I can fix this? I've been stuck on this for a while. Thanks a ton.
Errors:
[2015-02-21 11:44:42] ERROR bad URI `/bands/1/[object%20Object]'. (Console)
[Error] Failed to load resource: the server responded with a status of 400
(Bad Request) ([object Object], line 0) (Safari dev window)
Javascript:
var ready;
alert("Hello");
ready = function() {
$(function() {
$('#s3_uploader').S3Uploader(
{
remove_completed_progress_bar: true,
progress_bar_target: $('#uploads_container')
}
);
$('#s3_uploader').bind('s3_upload_failed', function(e, content) {
return alert(content.filename + ' failed to upload');
});
});
};
$(document).ready(ready);
$(document).on('page:load', ready);
Bands View
<%= s3_uploader_form callback_url: bands_url,
id: "s3_uploader",
callback_param: "song[direct_upload_url]",
expiration: 24.hours.from_now.utc.iso8601,
max_file_size: 100.megabytes do %>
<%= file_field_tag :file, multiple: true %>
<% end %>
<div id="uploads_container"></div>
<script id="template-upload" type="text/x-tmpl">
<div id = "upload_{%=o.unique_id%}" class="upload">
<h5>{%=o.name%}</h5>
<div class="progress progress-striped active"><div class="bar" style="width: 0%"></div></div>
</div>
</script>