rails_admin_toggleable 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -26,16 +26,17 @@ module RailsAdmin
|
|
26
26
|
method = params[:method]
|
27
27
|
obj.send(method + '=', params[:on] == '1' ? true : false)
|
28
28
|
if obj.save
|
29
|
-
|
29
|
+
flash[:success] = "OK"
|
30
30
|
else
|
31
|
-
|
31
|
+
flash[:error] = obj.errors.full_messages.join(', ')
|
32
32
|
end
|
33
33
|
rescue Exception => e
|
34
|
-
|
34
|
+
flash[:error] = "Error: #{e}"
|
35
35
|
end
|
36
36
|
else
|
37
|
-
|
37
|
+
flash[:error] = 'No ID'
|
38
38
|
end
|
39
|
+
redirect_to :back
|
39
40
|
end
|
40
41
|
end
|
41
42
|
|