I have a model: ThreadParticipation
I want to build a link that send the ThreadParticipation.id and a param hide == true.
How can I build a link that does this?
ThreadParticipation Controller:
def hide
@record = ThreadParticipation.find(params[:id)
@record.hide == params[:hide]
@record.save
end
View:
<%= link_to "hide", '/thread/:id/thread_participations/:id/hide', :remote => true %>
Does that look right? How do I pass a param a long with the link_to (hide == true) ? Any ideas?
Thanks
You could try this
Or better still, define a route to get the /thread/:thread_id/thread_participation/:id part. Lets say the route is hide_thead_pariticipation_thread_path
Also your controller code seems to be using “@record.hide == params[:hide]”. Maybe its just a = there?