0
我有一個模型:ThreadParticipation如何建立一個remote_to鏈接,並通過設置了一個param
我想建立一個發送ThreadParticipation.id和PARAM隱藏== true的鏈接。
我該如何建立一個鏈接來做到這一點?
ThreadParticipation控制器:
def hide
@record = ThreadParticipation.find(params[:id)
@record.hide == params[:hide]
@record.save
end
查看:
<%= link_to "hide", '/thread/:id/thread_participations/:id/hide', :remote => true %>
是否正確?如何通過link_to(hide == true)傳遞一個參數?有任何想法嗎?
感謝