我試圖得到這個工作,我有這個Rails的在其中方法不工作
語法錯誤,意想不到的 '=',預計 ')' @tm = Master.where( 「merchant_deep_link」= NE)
而且這是在我的控制器
@newevent = Event.find(params[:id])
ne = @newevent.Master
@tm = Master.where("merchant_deep_link" = ne)
我如何去製作@tm
顯示所有的結果是有ne
內Merchant_deep_link
並返回行(有可能是隻有其中一個但是它確實有掃描24K行)
嘿,這有點作品,但是,如果我運行tm.id它不顯示ID? – SamAdmit
@SamAdmit:它是一個集合(即對象數組),因此您應該遍歷它,或者只是獲取所需的集合,例如,首先使用'first'(或者使用'find_by'而不是'where ') – potashin
仍然沒有什麼回來,我試過find_by,而不是說(甚至thogh它工作正常) – SamAdmit