link_to_delete_asciicast helper

openid
Marcin Kulik 12 years ago
parent fdf2a0c326
commit d86174d147

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

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

Loading…
Cancel
Save