cruj_cruj_cruj 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/cruj_cruj_cruj_controller.rb +11 -3
- data/lib/cruj_cruj_cruj/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: 650f80cdadc83ce5ac92c19fe4a5c1f2ee6b091d
|
4
|
+
data.tar.gz: d8e32fd1285fad8bc61567690366aefb6bb2377f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 09ea6309a91fa3fb3f72669a4f97482fddc4251c9e0a60fd5128ce0bc761f9ea204c3710af8ea0cc096dfba14881d23aab3afb0d275cc73a96c03d2323a67cfe
|
7
|
+
data.tar.gz: de74aea8c58ae7835e39ad502985d7e842f5baeddf4927a40425cbaf4e0c70b9104d2563dcbab1e6d70ebb42ba877f01218cc62cec767dbfa7aa9e15ef1e4c43
|
@@ -33,7 +33,7 @@ class CrujCrujCrujController < ApplicationController
|
|
33
33
|
def edit; end
|
34
34
|
|
35
35
|
def update
|
36
|
-
if @resource.update_attributes(
|
36
|
+
if @resource.update_attributes(safe_parameters)
|
37
37
|
redirect_to(action: :index, notice: l("#{snake_case_model_name}_edit_success_message"))
|
38
38
|
else
|
39
39
|
render action: 'edit'
|
@@ -86,7 +86,11 @@ class CrujCrujCrujController < ApplicationController
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def build_resource
|
89
|
-
@resource = model_class.new(
|
89
|
+
@resource = model_class.new(safe_parameters)
|
90
|
+
end
|
91
|
+
|
92
|
+
def safe_parameters
|
93
|
+
params.require(snake_case_model_name).permit!
|
90
94
|
end
|
91
95
|
|
92
96
|
def find_resource
|
@@ -108,7 +112,11 @@ class CrujCrujCrujController < ApplicationController
|
|
108
112
|
end
|
109
113
|
|
110
114
|
def model_name
|
111
|
-
|
115
|
+
if @resource
|
116
|
+
@resource.class.name
|
117
|
+
else
|
118
|
+
self.class.name.sub(/Controller$/, '').singularize
|
119
|
+
end
|
112
120
|
end
|
113
121
|
|
114
122
|
def model_class
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cruj_cruj_cruj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Victor Campos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|