任何人都可以params
在Rails控制器中进行解释:它们来自何处以及它们所引用的是什么?
def create
@vote = Vote.new(params[:vote])
item = params[:vote][:item_id]
uid = params[:vote][:user_id]
@extant = Vote.find(:last, :conditions => ["item_id = ? AND user_id = ?", item, uid])
last_vote_time = @extant.created_at unless @extant.blank?
curr_time = Time.now
end
我希望能够逐行阅读此代码并了解发生了什么。