link_to_delete_asciicast helper

openid
Marcin Kulik 12 years ago
parent fdf2a0c326
commit d86174d147

@ -27,4 +27,10 @@ module AsciicastsHelper
snapshot: asciicast.snapshot snapshot: asciicast.snapshot
} }
end end
def link_to_delete_asciicast(name, asciicast)
link_to name, asciicast_path(asciicast),
:method => :delete, :confirm => 'Really delete this asciicast?'
end
end end

@ -30,8 +30,7 @@
</li> </li>
<li> <li>
<%= link_to 'Delete', asciicast_path(@asciicast), <%= link_to_delete_asciicast 'Delete', @asciicast %>
:method => :delete, :confirm => 'Really delete this asciicast?' %>
</li> </li>
</ul> </ul>
<% end %> <% end %>

Loading…
Cancel
Save