Skip to content

Commit c5a4bee

Browse files
committed
Merge pull request #1 from nbancajas/multipart_support
added multi-support when uploading images
2 parents efbf54f + bdc7de9 commit c5a4bee

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

app/controllers/pictures_controller.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def new
1111

1212
def create
1313
@picture = Picture.new
14-
@picture.avatar = params[:picture][:path]
14+
@picture.avatar = params[:picture][:path].shift
1515
if @picture.save
1616
respond_to do |format|
1717
format.html { #(html response is for browsers using iframe sollution)
@@ -33,4 +33,4 @@ def destroy
3333
@picture.destroy
3434
render :json => true
3535
end
36-
end
36+
end

app/views/shared/_fileupload.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<span class="btn btn-success fileinput-button">
77
<i class="icon-plus icon-white"></i>
88
<span><%= t('fileupload.add_files') %></span>
9-
<%= f.file_field :path %>
9+
<%= f.file_field :path, :multiple => true %>
1010
</span>
1111
<button type="submit" class="btn btn-primary start">
1212
<i class="icon-upload icon-white"></i>

0 commit comments

Comments
 (0)