Skip to content

Commit

Permalink
Merge pull request #1 from nbancajas/multipart_support
Browse files Browse the repository at this point in the history
added multi-support when uploading images
  • Loading branch information
jalagrange committed Sep 17, 2012
2 parents efbf54f + bdc7de9 commit c5a4bee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/controllers/pictures_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def new

def create
@picture = Picture.new
@picture.avatar = params[:picture][:path]
@picture.avatar = params[:picture][:path].shift
if @picture.save
respond_to do |format|
format.html { #(html response is for browsers using iframe sollution)
Expand All @@ -33,4 +33,4 @@ def destroy
@picture.destroy
render :json => true
end
end
end
2 changes: 1 addition & 1 deletion app/views/shared/_fileupload.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<span class="btn btn-success fileinput-button">
<i class="icon-plus icon-white"></i>
<span><%= t('fileupload.add_files') %></span>
<%= f.file_field :path %>
<%= f.file_field :path, :multiple => true %>
</span>
<button type="submit" class="btn btn-primary start">
<i class="icon-upload icon-white"></i>
Expand Down

0 comments on commit c5a4bee

Please sign in to comment.