0
我可能是愚蠢的,但:奇怪的問題訪問屬性
@activation_token = ActivationToken.where(:token => params[:id])
render(:text => @activation_token.inspect)
作品,並給出:
[#<ActivationToken id: 7, user_id: 21, token: "f4c3cb7c7629344e8261bf16e4a99900", used: false, created_at: "2013-01-25 10:48:57", updated_at: "2013-01-25 10:48:57">]
但
@activation_token.user_id
拋出:
undefined method `user_id' for #<ActiveRecord::Relation:0x007fbfe414ff18>
我錯過了什麼?