api_scaffold 0.1.1 → 0.1.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/README.md +9 -0
- data/lib/api_scaffold/version.rb +1 -1
- data/lib/generators/api_scaffold/api_scaffold_generator.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b4a10364cb3a18e82cd6926b9371f32c88dcf8eec7271746581db01a97e877c
|
4
|
+
data.tar.gz: e6f7f0e286b2941e75245bac1a9b1ad23390baac21d15a7a49bc41c118933e9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 583bd9cc6524a9eba7b14d211025c77f4d5948615ef74d9da6d2c3750c810a7c21f00287111857c2d3d1b50f13baca06d44baaf9e341a6b47112f9ac0600cc05
|
7
|
+
data.tar.gz: 0b279dfab905cda2ff8bd78e4bfd50ef34d9f27ae76e576570c2dbab9aaf464f130bbb4c7146bd27bfb6567b9bd03a6bd87d2c9938dc006037e82b72ede0c501
|
data/README.md
CHANGED
@@ -23,6 +23,15 @@ Or install it yourself as:
|
|
23
23
|
|
24
24
|
## Usage
|
25
25
|
|
26
|
+
Add this code to config/routes.rb
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
scope :api, defaults: { format: :json } do
|
30
|
+
namespace :v1 do
|
31
|
+
end
|
32
|
+
end
|
33
|
+
```
|
34
|
+
|
26
35
|
Execute this line in your terminal from your rails directory:
|
27
36
|
|
28
37
|
$ rails g api_scaffold Book title description:text
|
data/lib/api_scaffold/version.rb
CHANGED
@@ -39,7 +39,7 @@ module ApiScaffold
|
|
39
39
|
|
40
40
|
def add_routes
|
41
41
|
# Include tabs and line break for proper formatting
|
42
|
-
routes_string = " resources :#{controller_name}\n"
|
42
|
+
routes_string = " resources :#{controller_name}, except: [:new, :edit]\n"
|
43
43
|
# Inject into file following the api scope and v1 namespace
|
44
44
|
inject_into_file 'config/routes.rb', after: " scope :api, defaults: { format: :json } do\n namespace :#{prefix} do\n" do
|
45
45
|
routes_string
|