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