simple_crudify 1.2.0 → 1.2.1
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/README.md +3 -3
- data/bin/console +3 -3
- data/lib/simple_crudify/common_methods.rb +4 -0
- data/lib/simple_crudify/crud_actions.rb +3 -3
- data/lib/simple_crudify/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: 776659af4725f3b9d1303a58bf6c09c04c8d8172
|
4
|
+
data.tar.gz: a5c2dcd0ce90a9525d9c2444ab85bac420dd02a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db2015525cc38866d5dd653fe93e0a469dcac050eec64c7df4914c1576139ff29b2c3b92a4f10430f6af8495b1a6d7eb25233b56701d799fc937471dab94a4d1
|
7
|
+
data.tar.gz: dd6c78b0e31247b8d59157c9b47836e3cd054ebd1df7b5ee57d8188f62d7d6cb0b2cfbc1cf4e9abbf0ea16576248dff0946d2ca318e3c9620c1ae28c93ae90bb
|
data/README.md
CHANGED
@@ -27,7 +27,7 @@ A short example
|
|
27
27
|
class UsersController < ApplicationController
|
28
28
|
include SimpleCrudify::Crudify
|
29
29
|
|
30
|
-
|
30
|
+
actions :crud
|
31
31
|
|
32
32
|
def model_klass
|
33
33
|
User
|
@@ -58,8 +58,8 @@ end
|
|
58
58
|
The first required configuration is an action name.
|
59
59
|
|
60
60
|
```ruby
|
61
|
-
|
62
|
-
|
61
|
+
actions :index, :show, :new, :create
|
62
|
+
actions :crud # an alias for all actions
|
63
63
|
```
|
64
64
|
|
65
65
|
Other settings
|
data/bin/console
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'simple_crudify'
|
5
5
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +10,5 @@ require "simple_crudify"
|
|
10
10
|
# require "pry"
|
11
11
|
# Pry.start
|
12
12
|
|
13
|
-
require
|
13
|
+
require 'irb'
|
14
14
|
IRB.start(__FILE__)
|
@@ -29,7 +29,7 @@ module SimpleCrudify
|
|
29
29
|
@resource = model_klass.new(resource_params)
|
30
30
|
|
31
31
|
if @resource.save
|
32
|
-
redirect_to after_create_path
|
32
|
+
redirect_to after_create_path, notice: controller_notice(action_name)
|
33
33
|
else
|
34
34
|
render template: template_path(:new)
|
35
35
|
end
|
@@ -49,7 +49,7 @@ module SimpleCrudify
|
|
49
49
|
@resource = model_klass.find(params[:id])
|
50
50
|
|
51
51
|
if @resource.update(resource_params)
|
52
|
-
redirect_to after_update_path
|
52
|
+
redirect_to after_update_path, notice: controller_notice(action_name)
|
53
53
|
else
|
54
54
|
render template: template_path(:edit)
|
55
55
|
end
|
@@ -61,7 +61,7 @@ module SimpleCrudify
|
|
61
61
|
@resource = model_klass.find(params[:id])
|
62
62
|
@resource.destroy
|
63
63
|
|
64
|
-
redirect_to after_destroy_path
|
64
|
+
redirect_to after_destroy_path, notice: controller_notice(action_name)
|
65
65
|
end
|
66
66
|
end
|
67
67
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_crudify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitriy Strukov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|