api_scaffold 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7f457af2521d265949c3121cd7f36ff820c9395667bf0016c87b3eaf279a01b9
4
- data.tar.gz: 0ca9d6d85026dffe2cffc8d88b9c6a5622e4d1c3fb90f123a934bbc0cca9a4b0
3
+ metadata.gz: 4b4a10364cb3a18e82cd6926b9371f32c88dcf8eec7271746581db01a97e877c
4
+ data.tar.gz: e6f7f0e286b2941e75245bac1a9b1ad23390baac21d15a7a49bc41c118933e9e
5
5
  SHA512:
6
- metadata.gz: 8da7da2d33b04d3c20b9baf7fea21dc5b1de996af11cc59466861c41543b3b7e9dfe5d511237f0a4d90f19b16e702fa399928da80165b38d4e2228125a9335a3
7
- data.tar.gz: da0656791b4a4f41dfcae15ce1292458e76d25a49304220523226259a0560cec847ab655fcd92ddeb7a6ed46748b0f1937bc3b17c930f78e051829d0e4a2b8bd
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
@@ -1,3 +1,3 @@
1
1
  module ApiScaffold
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Atkinson