Quantity#destroy changed to AJAX
This commit is contained in:
parent
daf0bd421e
commit
3cec0847df
@ -23,7 +23,8 @@ class QuantitiesController < ApplicationController
|
||||
if @quantity.destroy
|
||||
flash[:notice] = 'Deleted quantity'
|
||||
end
|
||||
redirect_to project_quantities_url(@project)
|
||||
@quantities = @project.quantities
|
||||
render :toggle
|
||||
end
|
||||
|
||||
def toggle
|
||||
|
@ -76,7 +76,9 @@
|
||||
</td>
|
||||
<td class="domain"><%= q.domain %></td>
|
||||
<td class="description"><%= q.description %></td>
|
||||
<td class="action"><%= delete_link quantity_path(q), data: {} %></td>
|
||||
<td class="action">
|
||||
<%= delete_link quantity_path(q), {remote: true, data: {}} %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
@ -1 +1,3 @@
|
||||
$('div[id^=flash_]').remove();
|
||||
$('#content').prepend('<%= escape_javascript(render_flash_messages) %>');
|
||||
$('#quantities').html('<%= escape_javascript(render :partial => 'quantities/list') %>');
|
||||
|
Reference in New Issue
Block a user