Skip to content

Instantly share code, notes, and snippets.

@lukaskonarovsky
Created February 20, 2009 20:01
Show Gist options
  • Save lukaskonarovsky/67666 to your computer and use it in GitHub Desktop.
Save lukaskonarovsky/67666 to your computer and use it in GitHub Desktop.
Nested attributes rocks!
<% if f.object.new_record? %>
<%= link_to_function "Smazat", "$(this).up('.line').remove(); " %>
<% else %>
<%= f.hidden_field(:_delete) %>
<%= link_to_function "Smazat", "$(this).previous().value = '1'; $(this).up('.line').hide(); " %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment