rest_area 2.0.0 → 2.0.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 +7 -0
- data/app/controllers/rest_area/rest_controller.rb +2 -2
- data/lib/rest_area/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: eb28d86bdd602208f1527f32af1b11dc054972cf
|
|
4
|
+
data.tar.gz: a5f330b83c1324289d45d4750e1b91523b3ea7fb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 63b603f71211945f94190d49e946a74b5f3beef224d54c9186e4a8342e7a21178d74be9a4ed744020ad1cda57823c4d1c24fa1d713d118d15e8549298d6daf8a
|
|
7
|
+
data.tar.gz: e8c21ec3753a9494f1cf36787a46a20f2780247471ea32ff8d15f8f1815025a247a4c30af04259ef1bf272fc89586075da95ebfa7624ed9b3b8e8e109dbc9846
|
data/README.md
CHANGED
|
@@ -30,3 +30,10 @@ If you are using Rails 4.1.x you should use the master branch and/or versions/ta
|
|
|
30
30
|
|
|
31
31
|
mount RestArea::Engine => "/your_base_route"
|
|
32
32
|
|
|
33
|
+
# Serializers
|
|
34
|
+
|
|
35
|
+
But what if I want to customize the JSON that comes back? Simple this
|
|
36
|
+
gem supports [active_model_serializer][1]. Go there, ignore the stuff
|
|
37
|
+
about controllers.
|
|
38
|
+
|
|
39
|
+
[1]:https://github.com/rails-api/active_model_serializers
|
|
@@ -58,7 +58,7 @@ module RestArea
|
|
|
58
58
|
end
|
|
59
59
|
|
|
60
60
|
def klass_params
|
|
61
|
-
params.require(@root.to_sym).permit
|
|
61
|
+
params.require(@root.to_sym).permit!
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
def set_class_serializer
|
|
@@ -77,7 +77,7 @@ module RestArea
|
|
|
77
77
|
raise ActionController::RoutingError.new("Resource Does Not Exist")
|
|
78
78
|
end
|
|
79
79
|
|
|
80
|
-
@roots = ActionController::Base.helpers.sanitize(params[:klass])
|
|
80
|
+
@roots = ActionController::Base.helpers.sanitize(params[:klass]).pluralize
|
|
81
81
|
@root = @roots.singularize
|
|
82
82
|
end
|
|
83
83
|
|
data/lib/rest_area/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rest_area
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Benjamin Guest
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-05-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|