annotate app/views/attachments/toggle_active.rhtml @ 257:3ecf99348b9f feature_80

* Enable toggling file active state through the files interface
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Fri, 04 Mar 2011 12:46:26 +0000
parents
children ce817f379723
rev   line source
chris@257 1 <%=
chris@257 2 file = Attachment.find(params[:id])
chris@257 3 active_id = "active-" + file.id.to_s
chris@257 4 link_to_remote image_tag(file.active? ? 'true.png' : 'false.png'),
chris@257 5 :url => {:controller => 'attachments', :action => 'toggle_active', :project_id => @project.id, :id => file},
chris@257 6 :update => active_id
chris@257 7 %>