私のコードはこれです
def footstamp
if current_user
@user = User.find(params[:id])
@tracking = Tracking.where(:user_id => current_user.id, :target_user_id => @user.id)
if @tracking
@tracking.accessed_at = Time.now
@tracking.save
else
@tracking = Tracking.new
@tracking.user_id = current_user.id
@tracking.target_user_id = @user.id
@tracking.accessed_at = Time.now
@tracking.save
end
end
end
次に、このエラーが発生します
NoMethodError (undefined method `save' for []:ActiveRecord::Relation):