Skip to content

Instantly share code, notes, and snippets.

@fabiancarlos
Created June 23, 2021 15:26
Show Gist options
  • Save fabiancarlos/8c7473c1e31a76ca71559e85f357dbba to your computer and use it in GitHub Desktop.
Save fabiancarlos/8c7473c1e31a76ca71559e85f357dbba to your computer and use it in GitHub Desktop.
<%= text_field_tag :title, obj.title, data: { id: id, remote: true, url: url_for(nutri_workout_path(obj.id, workout_program: { title: obj.title })), method: :post } %>
<% content_for :js do %>
<script>
$('[data-id="<%= obj.id %>"]').bind('ajax:success', function() {
$(document).ajaxSuccess(function(event, request, settings) {
console.log("success", request.responseJSON.data)
});
});
</script>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment