Added separate destroy view
This commit is contained in:
parent
32ad182870
commit
df5fb71e10
@ -42,8 +42,6 @@ class MeasurementsController < ApplicationController
|
|||||||
if @measurement.destroy
|
if @measurement.destroy
|
||||||
flash[:notice] = 'Deleted measurement'
|
flash[:notice] = 'Deleted measurement'
|
||||||
end
|
end
|
||||||
prepare_measurements
|
|
||||||
render :index
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def retake
|
def retake
|
||||||
|
5
app/views/measurements/destroy.js.erb
Normal file
5
app/views/measurements/destroy.js.erb
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
$('div[id^=flash_]').remove();
|
||||||
|
$('#content').prepend('<%= j render_flash_messages %>');
|
||||||
|
<% if @measurement.destroyed? %>
|
||||||
|
$('tr[id=measurement-<%= @measurement.id %>]').remove();
|
||||||
|
<% end %>
|
Reference in New Issue
Block a user