simple_crud 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/simple_crud/version.rb +1 -1
- data/lib/simple_crud.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 425291b160b8789a8643a867c0e63354e503ad8a
|
|
4
|
+
data.tar.gz: 0dc9c1f8ea0a5913645f8a51c836acb96545af8d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 18463fea6f0096037cd186d7fbab687f8a76fe31e8e78c65ee00f8345652758f9a8eb41e6bda8e05456de4193046a068ff8f6ed3b3cea99be085bc4f2c4abeda
|
|
7
|
+
data.tar.gz: ca7a47e70a23ee1a054b6719494565b2022479bbb02a735894cc3aee41f3f455bc5bef68297ebb774799d66781c6e378a81357bcd5c1a0f144514c816c8933e1
|
data/lib/simple_crud/version.rb
CHANGED
data/lib/simple_crud.rb
CHANGED
|
@@ -4,7 +4,7 @@ module SimpleCrud
|
|
|
4
4
|
instance.class.name.underscore.humanize
|
|
5
5
|
end
|
|
6
6
|
|
|
7
|
-
def create_(instance, path, r)
|
|
7
|
+
def create_(instance, path, r) # Save the instance, Redirect_to if save successful, #render template if not successful
|
|
8
8
|
if instance.save
|
|
9
9
|
redirect_to path, notice: class_name(instance) + " created."
|
|
10
10
|
else
|
|
@@ -12,7 +12,7 @@ module SimpleCrud
|
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
def update_(instance, strong_params, path)
|
|
15
|
+
def update_(instance, strong_params, path) # Update the instance, Redirect_to if successful, # Always renders edit
|
|
16
16
|
if instance.update(strong_params)
|
|
17
17
|
redirect_to path, notice: class_name(instance) + " updated."
|
|
18
18
|
else
|
|
@@ -20,7 +20,7 @@ module SimpleCrud
|
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
def destroy_(instance, path)
|
|
23
|
+
def destroy_(instance, path) # Delete instance, Redirect_to after delete
|
|
24
24
|
instance.destroy
|
|
25
25
|
redirect_to path, notice: class_name(instance) + " deleted."
|
|
26
26
|
end
|