0
當他/她無法更新該模型的其他屬性時,如何說'教師'只更新模型的某個屬性(比如模型'book')使用Cancan和Best_In_Place。據我所知,屬性的授權尚不支持在黃燦燦的,因爲它仍然是正在開發2.0,所以我想的第一件事就是用這樣的:如何使用Best_In_Place和Cancan更新來自受限模型的特定屬性
cannot :all, Book
if is_teacher?
can :update_certain_attribute, Book
end
但因爲我想用Best_In_Place,我的初步研究告訴我,我只能使用屬性爲Best_In_Place更新 像下面
<%= best_in_place @book, :certain_attribute, :type => :input %>
,而不是方法:
<%= best_in_place @book, :update_certain_attribute, :type => :input %>
處理這個問題的最佳方法是什麼?謝謝:)
嗯我有點困惑我怎麼能實現這個:)簡單地看着它讓我覺得我不會再使用best_in_place ...或者我錯了嗎? :)無論如何,謝謝我以後會在家裏檢查這個問題:) –