Skip to content
Extraits de code Groupes Projets
Valider 7223d217 rédigé par Raphael's avatar Raphael
Parcourir les fichiers

Add singular move friend route, it must be eliminated later

parent 5ff1bdae
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -65,5 +65,14 @@ class GroupsController < ApplicationController ...@@ -65,5 +65,14 @@ class GroupsController < ApplicationController
redirect_to Group.first, :action => "edit" redirect_to Group.first, :action => "edit"
end end
def move_friend
unless current_user.move_friend( :friend_id => params[:friend_id], :from => params[:from], :to => params[:to][:to])
flash[:error] = "didn't work #{params.inspect}"
end
if group = Group.first(:id => params[:to][:to])
redirect_to group
else
redirect_to Person.first(:id => params[:friend_id])
end
end
end end
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
%li %li
%i= "friends since: #{how_long_ago(@person)}" %i= "friends since: #{how_long_ago(@person)}"
%li %li
= form_tag move_friends_path = form_tag move_friend_path
= select :to, :to, @groups_dropdown_array, :selected_value => @groups_with_person.first.id = select :to, :to, @groups_dropdown_array, :selected_value => @groups_with_person.first.id
= hidden_field_tag :from, :from, :value => @groups_with_person.first.id = hidden_field_tag :from, :from, :value => @groups_with_person.first.id
= hidden_field_tag :friend_id, :friend_id, :value => @person.id = hidden_field_tag :friend_id, :friend_id, :value => @person.id
......
...@@ -21,6 +21,7 @@ Diaspora::Application.routes.draw do ...@@ -21,6 +21,7 @@ Diaspora::Application.routes.draw do
match 'logout', :to => 'devise/sessions#destroy', :as => "destroy_user_session" match 'logout', :to => 'devise/sessions#destroy', :as => "destroy_user_session"
match 'get_to_the_choppa', :to => 'devise/registrations#new', :as => "new_user_registration" match 'get_to_the_choppa', :to => 'devise/registrations#new', :as => "new_user_registration"
match 'groups/move_friends', :to => 'groups#move_friends', :as => 'move_friends' match 'groups/move_friends', :to => 'groups#move_friends', :as => 'move_friends'
match 'groups/move_friend', :to => 'groups#move_friend', :as => 'move_friend'
#public routes #public routes
# #
match 'webfinger', :to => 'publics#webfinger' match 'webfinger', :to => 'publics#webfinger'
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter