rails_location_header 1.0.1 → 1.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 941141f446f4cdf43b321c173f20fed5afbf132f4a0d34fe3265c4b4d974b182
4
- data.tar.gz: e411dc790ef6ccf393e7d24c2bd6c86ba3826adfa5a52b9a99e2121b823be160
3
+ metadata.gz: 3998d156e632dbba5a1bdc4b5d418ff51dab1d93d4f29e72c244d8d0f76e9a46
4
+ data.tar.gz: 732d121b2e044c68595f505e6056977250fda8f16ca6dfc681b72aafe5d9e2c0
5
5
  SHA512:
6
- metadata.gz: bdfd34a0e402297aaab4735e34d5bd3b865f0b733120805c83014798b0c1938d150a97a2fef7306edab2feab48e4be84e97db8692178d16aabb919505d5537d4
7
- data.tar.gz: bd1d9a54e8cca01da0a9ae4e557bdd18d7279b682aa60d44a5e483aad903bb90a5e0df403ec7be33ec26b5c91b7a8a972edf90a56933da0f1dd7571b5f244718
6
+ metadata.gz: 80bfbc95b3893e7125faaf292c11d0d61f390f66b615c2dea30278c8ebb91a16493ad51889cb22b8f8660e461534346ab45601f40f9add1210d0bf79178b0f43
7
+ data.tar.gz: 1586bd510a084e6c00caef89ce24fce0d05e0199408428f407da953afb8d297c18db05ed1aee9780c062dabde1308643d659ba7ea37ae09aa1ea03f2fb7283bc
data/README.md CHANGED
@@ -18,12 +18,22 @@ gem install rails_location_header
18
18
 
19
19
  ## Usage
20
20
 
21
- To use this gem, include it in your Rails application. The gem automatically integrates with Rails controllers via a Railtie. When a `create` action successfully creates a resource (with a `201 Created` status), the following headers are added to the response:
21
+ To use this gem, include it in your Rails application. The gem automatically integrates with Rails controllers via a Railtie and works out of the box.
22
+
23
+ ### How It Works
24
+
25
+ 1. **`create` action with a 201 status**: The `create` action must return an HTTP `201 Created` status.
26
+ 2. **Instance variable**: Declare an instance variable in the `create` action that matches the entity name (e.g., `@post` in `PostsController`).
27
+ 3. **`show` action and route**: Ensure the controller has a `show` action and a corresponding route to construct the resource's URL.
28
+
29
+ ### Headers Added
30
+
31
+ When the above requirements are met, the gem automatically adds the following headers to the response:
22
32
 
23
33
  - `X-Entity-ID`: The ID of the created resource.
24
34
  - `Location`: The URL of the created resource.
25
35
 
26
- No additional configuration is required. Simply include the gem in your project, and it will work out of the box.
36
+ No additional configuration is needed.
27
37
 
28
38
  ## Development
29
39
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsLocationHeader
4
- VERSION = '1.0.1'
4
+ VERSION = '1.0.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_location_header
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eli Sebastian Herrera Aguilar
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-03-25 00:00:00.000000000 Z
10
+ date: 2025-04-21 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rails
@@ -52,7 +51,6 @@ metadata:
52
51
  homepage_uri: https://github.com/EliSebastian/rails_location_header
53
52
  source_code_uri: https://github.com/EliSebastian/rails_location_header
54
53
  changelog_uri: https://github.com/EliSebastian/rails_location_header/blob/main/CHANGELOG.md
55
- post_install_message:
56
54
  rdoc_options: []
57
55
  require_paths:
58
56
  - lib
@@ -67,8 +65,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
65
  - !ruby/object:Gem::Version
68
66
  version: '0'
69
67
  requirements: []
70
- rubygems_version: 3.5.22
71
- signing_key:
68
+ rubygems_version: 3.6.2
72
69
  specification_version: 4
73
70
  summary: Adds X-Entity-ID and Location headers in create actions.
74
71
  test_files: []