3296: manage profile page added
[arvados.git] / apps / workbench / app / controllers / projects_controller.rb
index 785773688d0f0de3d121b9b3cd73722015f66e3d..2b605d3f834feb4e5deb425598a3b16522f2094f 100644 (file)
@@ -62,25 +62,20 @@ class ProjectsController < ApplicationController
       each do |resource_class|
       resource_class.filter([['uuid','in',uuids_to_add]]).each do |dst|
         if resource_class == Collection
-          dst = Link.new(owner_uuid: target_object.uuid,
-                         tail_uuid: target_object.uuid,
-                         head_uuid: target_uuid,
+          dst = Link.new(owner_uuid: target_uuid,
+                         tail_uuid: target_uuid,
+                         head_uuid: dst.uuid,
                          link_class: 'name',
                          name: target_uuid)
         else
           dst.owner_uuid = target_uuid
           dst.tail_uuid = target_uuid if dst.class == Link
         end
-        begin
-          dst.save!
-        rescue
-          dst.name += " (#{Time.now.localtime})" if dst.respond_to? :name=
-          dst.save!
-        end
+        dst.save!
       end
     end
     session[:selected_move_items] = nil
-    redirect_to controller: 'projects', action: :show, id: target_uuid
+    redirect_to @object
   end
 
   def destroy