xavius-controllers 0.1.2 → 0.1.3
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/xavius/controllers/base.rb +2 -2
- data/lib/xavius/controllers/helpers.rb +6 -6
- data/lib/xavius/controllers/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 46d03ba892f9c333a8fa45c29cc04999664c9fd5d9e728b208dba001a150ba0d
|
|
4
|
+
data.tar.gz: f3154c91f7c4e34491b67cac985542330c9ca4366c2d6d9abd8cc43385a2a812
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 659e729bbb9c28dea51e5ccbff2a61b44944b2ebc58d80ed1c1200f26a1d05551094d5612d6fd231ba11eaf953b7e64c6ff4eea0be45c392d9f836e9d286f8f1
|
|
7
|
+
data.tar.gz: 12c39316a0983defb6435b5ea4c203c8eff9add3eb6fde5b254ece614fada3b0132624e2c017f1053856a85ad9c27141db88ec8571e4d9af93086b458c1213f8
|
|
@@ -20,7 +20,7 @@ module Xavius
|
|
|
20
20
|
format.html { redirect_to action_context.resource, notice: success_message }
|
|
21
21
|
format.json { render :show, status: :created, location: action_context.resource }
|
|
22
22
|
else
|
|
23
|
-
format.html { render :new }
|
|
23
|
+
format.html { render :new, status: :unprocessable_entity }
|
|
24
24
|
format.json { render json: action_context.resource.errors, status: :unprocessable_entity }
|
|
25
25
|
end
|
|
26
26
|
end
|
|
@@ -32,7 +32,7 @@ module Xavius
|
|
|
32
32
|
format.html { redirect_to action_context.resource, notice: success_message }
|
|
33
33
|
format.json { render :show, status: :ok, location: action_context.resource }
|
|
34
34
|
else
|
|
35
|
-
format.html { render :edit }
|
|
35
|
+
format.html { render :edit, status: :unprocessable_entity }
|
|
36
36
|
format.json { render json: action_context.resource.errors, status: :unprocessable_entity }
|
|
37
37
|
end
|
|
38
38
|
end
|
|
@@ -31,6 +31,10 @@ module Xavius
|
|
|
31
31
|
I18n.t('.success', default: I18n.t(:success, scope: [:resource, action_name], resource_name: resource_human_name))
|
|
32
32
|
end
|
|
33
33
|
|
|
34
|
+
def controller_name_sanitized
|
|
35
|
+
controller_name.gsub("/", "_")
|
|
36
|
+
end
|
|
37
|
+
|
|
34
38
|
private
|
|
35
39
|
def action_class
|
|
36
40
|
infer_user_action_class || "Xavius::Actions::#{action_name.camelize}".constantize
|
|
@@ -58,15 +62,11 @@ module Xavius
|
|
|
58
62
|
end
|
|
59
63
|
|
|
60
64
|
def collection_name
|
|
61
|
-
|
|
65
|
+
controller_name_sanitized.freeze
|
|
62
66
|
end
|
|
63
67
|
|
|
64
68
|
def instance_name
|
|
65
|
-
|
|
66
|
-
end
|
|
67
|
-
|
|
68
|
-
def infer_from_controller
|
|
69
|
-
controller_name.gsub("/", "_")
|
|
69
|
+
controller_name_sanitized.singularize.freeze
|
|
70
70
|
end
|
|
71
71
|
end
|
|
72
72
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: xavius-controllers
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Emerson Xavier
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-03-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|
|
@@ -67,7 +67,7 @@ dependencies:
|
|
|
67
67
|
- !ruby/object:Gem::Version
|
|
68
68
|
version: '5.0'
|
|
69
69
|
description: Keep your controllers clean and reuse common REST behaviour
|
|
70
|
-
email:
|
|
70
|
+
email:
|
|
71
71
|
executables: []
|
|
72
72
|
extensions: []
|
|
73
73
|
extra_rdoc_files: []
|
|
@@ -92,7 +92,7 @@ metadata:
|
|
|
92
92
|
source_code_uri: https://github.com/xavius-rb/xavius/tree/master/xavius-controllers
|
|
93
93
|
allowed_push_host: https://rubygems.org/
|
|
94
94
|
changelog_uri: https://github.com/xavius-rb/xavius/tree/master/xavius-controllers/CHANGELOG.md
|
|
95
|
-
post_install_message:
|
|
95
|
+
post_install_message:
|
|
96
96
|
rdoc_options: []
|
|
97
97
|
require_paths:
|
|
98
98
|
- lib
|
|
@@ -107,8 +107,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
107
107
|
- !ruby/object:Gem::Version
|
|
108
108
|
version: '0'
|
|
109
109
|
requirements: []
|
|
110
|
-
rubygems_version: 3.
|
|
111
|
-
signing_key:
|
|
110
|
+
rubygems_version: 3.2.32
|
|
111
|
+
signing_key:
|
|
112
112
|
specification_version: 4
|
|
113
113
|
summary: Reusable controller utilities
|
|
114
114
|
test_files: []
|