1
我可能會遺漏一些簡單的東西,但是如何通過非持久屬性找到記錄?Rails find_by訪問者
例
class Post < ActiveRecord::Base
attr_accessible :title
attr_accessor :slug
def slug
title.parameterize
end
end
我使用Rails 3.2.11
這就是我爲了時間的利益而做的,我想這很有道理。感謝您的確認Dan。 – mehulkar