14 lines
476 B
Text
14 lines
476 B
Text
<% # expects subscription and current_user %>
|
|
<%= form_for([current_user, subscription],
|
|
method: subscription.new_record? ? 'post' : 'delete',
|
|
html: {
|
|
class: 'ajax-create-destroy',
|
|
data: {
|
|
create_value: ts('Subscribe'),
|
|
destroy_value: ts('Unsubscribe')
|
|
}
|
|
}) do |f| %>
|
|
<%= f.hidden_field :subscribable_id %>
|
|
<%= f.hidden_field :subscribable_type %>
|
|
<%= f.submit subscription.new_record? ? ts('Subscribe') : ts('Unsubscribe') %>
|
|
<% end %>
|