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 +4 -4
- data/README.md +12 -2
- data/lib/rails_location_header/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3998d156e632dbba5a1bdc4b5d418ff51dab1d93d4f29e72c244d8d0f76e9a46
|
4
|
+
data.tar.gz: 732d121b2e044c68595f505e6056977250fda8f16ca6dfc681b72aafe5d9e2c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
36
|
+
No additional configuration is needed.
|
27
37
|
|
28
38
|
## Development
|
29
39
|
|
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.
|
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-
|
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.
|
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: []
|