@@ -41,15 +41,15 @@ def create
4141 # Redirect back to task#show as collections with tasks can only be created from that view
4242 create_collection_with_task
4343 elsif @collection . save
44- redirect_to collections_path , notice : t ( 'common.notices.object_created' , model : Collection . model_name . human )
44+ redirect_to Collection , notice : t ( 'common.notices.object_created' , model : Collection . model_name . human )
4545 else
4646 render :new
4747 end
4848 end
4949
5050 def update
5151 if @collection . update ( collection_params )
52- redirect_to collections_path , notice : t ( 'common.notices.object_updated' , model : Collection . model_name . human )
52+ redirect_to Collection , notice : t ( 'common.notices.object_updated' , model : Collection . model_name . human )
5353 else
5454 render :edit
5555 end
@@ -94,9 +94,9 @@ def download_all
9494
9595 def share
9696 if share_message . save
97- redirect_to collection_path ( @collection ) , notice : t ( '.success_notice' )
97+ redirect_to @collection , notice : t ( '.success_notice' )
9898 else
99- redirect_to collection_path ( @collection ) , alert : share_message . errors . full_messages . join ( ', ' )
99+ redirect_to @collection , alert : share_message . errors . full_messages . join ( ', ' )
100100 end
101101 end
102102
@@ -119,10 +119,10 @@ def save_shared # rubocop:disable Metrics/AbcSize
119119 def leave
120120 if @collection . users . count == 1
121121 @collection . destroy
122- redirect_to collections_path , notice : t ( 'common.notices.object_deleted' , model : Collection . model_name . human )
122+ redirect_to Collection , notice : t ( 'common.notices.object_deleted' , model : Collection . model_name . human )
123123 else
124124 @collection . users . delete ( current_user )
125- redirect_to collections_path , notice : t ( '.left_successfully' )
125+ redirect_to Collection , notice : t ( '.left_successfully' )
126126 end
127127 end
128128
0 commit comments