Skip to content

Commit

Permalink
Issue 1867 - images_controller.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
tbuyle committed Aug 29, 2012
1 parent c8a01a4 commit 9e2658c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion images/app/controllers/refinery/admin/images_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,12 @@ def create
unless params[:image].present? and params[:image][:image].is_a?(Array)
@images << (@image = ::Refinery::Image.create(params[:image]))
else
#copy other params than :image in a new Hash
images_params = params[:image].dup
images_params.delete(:image)
#create images
params[:image][:image].each do |image|
@images << (@image = ::Refinery::Image.create(:image => image))
@images << (@image = ::Refinery::Image.create({:image => image}.merge(images_params)))
end
end
rescue Dragonfly::FunctionManager::UnableToHandle
Expand Down

0 comments on commit 9e2658c

Please sign in to comment.