Class FriendsController
In: app/controllers/my_profile/friends_controller.rb
Parent: MyProfileController

Methods

add   index   remove  

Public Instance methods

[Source]

    # File app/controllers/my_profile/friends_controller.rb, line 9
 9:   def add
10:     @friend = Person.find(params[:id])
11:     if request.post? && params[:confirmation]
12:       # FIXME this shouldn't be in Person model?
13:       AddFriend.create!(:person => profile, :friend => @friend, :group_for_person => params[:group])
14: 
15:       flash[:notice] = _('%s still needs to accept being your friend.') % @friend.name
16:       # FIXME shouldn't redirect to the friend's page?
17:       redirect_to :action => 'index' 
18:     end
19:   end

[Source]

   # File app/controllers/my_profile/friends_controller.rb, line 5
5:   def index
6:     @friends = profile.friends
7:   end

[Source]

    # File app/controllers/my_profile/friends_controller.rb, line 21
21:   def remove
22:     @friend = profile.friends.find(params[:id])
23:     if request.post? && params[:confirmation]
24:       profile.remove_friend(@friend)
25:       redirect_to :action => 'index'
26:     end
27:   end

[Validate]