| Class | FriendshipsController |
| In: |
app/controllers/friendships_controller.rb
|
| Parent: | ApplicationController |
# 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