Sha256: 855eaf329817d369faa4f8fb5cf32a72d632d2b8df6918cd70e578e56b53a0eb
Contents?: true
Size: 1.28 KB
Versions: 15
Compression:
Stored size: 1.28 KB
Contents
<% if current_user %> <%- existing_bookmark = current_user.existing_bookmark_for(document[:id]) -%> <%- # Note these two forms are pretty similar but for different :methods, classes, and labels. # but it was simpler to leave them seperate instead of DRYing them, got confusing trying that. # the data-doc-id attribute is used by our JS that converts to a checkbox/label. -%> <% unless existing_bookmark %> <%= form_tag( bookmark_path( document[:id]), :method => :put, :class => "bookmark_toggle", "data-doc-id" => document[:id], :title=> document[document_show_link_field] ) do %> <%= hidden_field(:bookmark, :title, :value => document[document_show_link_field] ) %> <%= submit_tag("Bookmark", :id => "bookmark_toggle_#{document[:id]}", :class => "bookmark_add") %> <% end %> <% else %> <%= form_tag( bookmark_path( document[:id]), :method => :delete, :class => "bookmark_toggle", "data-doc-id" => document[:id], :title=> document[document_show_link_field]) do %> <%= hidden_field(:bookmark, :title, :value => document[document_show_link_field] ) %> <%= submit_tag("Remove bookmark", :id => "bookmark_toggle_#{document[:id]}", :class => "bookmark_remove") %> <% end %> <% end %> <% else %> <% end %>
Version data entries
15 entries across 13 versions & 2 rubygems