4
我需要關於如何在rails3應用程序中實現AMISTAD gem的幫助。請建議一些教程或意見?我看到了github amistad鏈接。但我想全面涵蓋這個寶石。請幫幫我。如何在rails3中使用amistad gem?
我需要關於如何在rails3應用程序中實現AMISTAD gem的幫助。請建議一些教程或意見?我看到了github amistad鏈接。但我想全面涵蓋這個寶石。請幫幫我。如何在rails3中使用amistad gem?
寶石創造者請給我如何利用創業板嘗試這些例子,創建一個友誼控制器處理方法
class FriendshipsController < ApplicationController
before_filter :authenticate_user!
def index
@friends = current_user.friends
@pending_invited_by = current_user.pending_invited_by
@pending_invited = current_user.pending_invited
end
def create
@Friend = User.find(params[:user_id])
@friendship_created = current_user.invite(@Friend)
if @friendship_created
flash.now[:notice] = "Une demande d'amiti a t envoye #{@friend.fullname}"
end
end
def approve
@Friend = User.find(params[:user_id])
@friendship_approved = current_user.approve(@Friend)
@friends = current_user.friends
@pending_invited_by = current_user.pending_invited_by
flash.now[:notice] = "La demande d'amiti de #{@friend.fullname} a t approuve"
end
def remove
@Friend = User.find(params[:user_id])
@friendship = current_user.send(:find_any_friendship_with, @Friend)
if @friendship
@friendship.delete
@removed = true
flash.now[:notice] = "L'amiti aveC#{@friend.fullname} a t supprime"
end
end
end
感謝您的回覆..它幫助了我很多 – UserROR 2011-11-08 09:59:22
接受的答案然後 – 2011-11-17 16:02:09
@UserROR我一直在試圖實現這個寶石的幾個問題。你有這個工作嗎?你的路線是什麼樣的?在您的視圖中添加或刪除朋友是什麼樣的?我知道這已經過了幾年了,但認爲這值得一試。 – Thomas 2013-07-30 13:26:02