templus_models 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/crud_controller.rb +12 -5
- data/lib/templus_models/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5416eadc5dfb02b33423613e21ecd0d4112b64d1
|
4
|
+
data.tar.gz: 4ed46660ad993f61e05a08d8690bcb3e413db680
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07e8a4ca8cbd5561af6a8892ecd279a54ebacdfaa6c887f578846bc7a00a8be32e38e5a26bccfb565dbf259fa67bf263c6d8e1733a1ea7cfaab5d05f155b8066
|
7
|
+
data.tar.gz: f57354012a1de695d90378856005f381345fc671a5a12200ea17bcc4db40f03e39a3cb2c8985a86cb81437173cd7a1f4b1a2c0b73c8f5e32f922119383721b31
|
@@ -92,11 +92,18 @@ class CrudController < ApplicationController
|
|
92
92
|
def destroy
|
93
93
|
authorize! :destroy, @model if respond_to?(:current_usuario)
|
94
94
|
@record = @model.find(params[:id])
|
95
|
-
@record.destroy
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
95
|
+
if @record.destroy
|
96
|
+
respond_to do |format|
|
97
|
+
flash[:success] = "Cadastro removido com sucesso."
|
98
|
+
format.html { redirect_to "/crud/#{@model.name.underscore}" }
|
99
|
+
format.js { render action: :index }
|
100
|
+
end
|
101
|
+
else
|
102
|
+
respond_to do |format|
|
103
|
+
flash[:error] = @record.errors.full_messages.join(", ")
|
104
|
+
format.html { redirect_to "/crud/#{@model.name.underscore}" }
|
105
|
+
format.js { render action: :index }
|
106
|
+
end
|
100
107
|
end
|
101
108
|
end
|
102
109
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: templus_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rodrigo Sol
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-05-
|
12
|
+
date: 2015-05-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|