Class FriendshipsController
In: app/controllers/friendships_controller.rb
Parent: ApplicationController

Methods

create   destroy  

Public Instance methods

[Source]

    # File app/controllers/friendships_controller.rb, line 2
 2:   def create
 3:     @friendship = current_user.friendships.build(:friend_id => params[:friend_id])
 4:     if @friendship.save
 5:       flash[:notice] = t(:friendship_added)
 6:       redirect_to users_path
 7:     else
 8:       flash[:error] = t(:friendship_not_added)
 9:       redirect_to users_path
10:     end
11:   end

[Source]

    # File app/controllers/friendships_controller.rb, line 13
13:   def destroy
14:     @friendship = current_user.friendships.find(params[:id])
15:     @friendship.destroy
16:     flash[:notice] = t(:friendship_successfully_destroyed)
17:     redirect_to current_user
18:   end

[Validate]