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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50a464b63ec6e656837da658f672d62dc13dd055
4
- data.tar.gz: 5a0885e74907099766c28bb08eeb73693d9d9b31
3
+ metadata.gz: 425291b160b8789a8643a867c0e63354e503ad8a
4
+ data.tar.gz: 0dc9c1f8ea0a5913645f8a51c836acb96545af8d
5
5
  SHA512:
6
- metadata.gz: 903c73a46de458884bb4acd645f60479e393dca62b1ffffb1b997515273e6e8fb50b0fe18c4f431bd2a08b6443f29a6627f4186f3e4bf4546485b36b464d8366
7
- data.tar.gz: bad7d5501dc50ed9fc9417954e51267a27d5fc467398d961b69da158c688b8d204848932bb8c1c561abea5ec7c3843968b2eb1cb3a35ea3553bb0c3c279c7cae
6
+ metadata.gz: 18463fea6f0096037cd186d7fbab687f8a76fe31e8e78c65ee00f8345652758f9a8eb41e6bda8e05456de4193046a068ff8f6ed3b3cea99be085bc4f2c4abeda
7
+ data.tar.gz: ca7a47e70a23ee1a054b6719494565b2022479bbb02a735894cc3aee41f3f455bc5bef68297ebb774799d66781c6e378a81357bcd5c1a0f144514c816c8933e1
@@ -1,3 +1,3 @@
1
1
  module SimpleCrud
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_crud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan-deJong