responders 3.0.0 → 3.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/CHANGELOG.md +4 -0
- data/MIT-LICENSE +1 -0
- data/README.md +11 -9
- data/lib/action_controller/respond_with.rb +1 -1
- data/lib/responders/flash_responder.rb +1 -1
- data/lib/responders/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00a016ab308a0960fc75a6dc1d6f8b35b3165fe0edfef25cb3b898631c7c0454
|
4
|
+
data.tar.gz: bf658c0505d528307b5b61b9c1854fa76b50269c7ddedc27f7c3816e588c2a1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 316cf7158bbfede88e505b1b2dfe25cf86ef873f678362da6062d5b4093849a190da2f730265021e7a3613f5a5bb1622553bc423d8850226ee5235083a9cf38b
|
7
|
+
data.tar.gz: 7aa5dbc3ef20b9c7ddafa0d8342067eaccfc2b50231eef76c00cf7c9a5e07703d449110ee4ec8dc4f3dcb9fa7c06472e0635cc3c41d05820a193c9f7445d14e7
|
data/CHANGELOG.md
CHANGED
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# Responders
|
2
2
|
|
3
3
|
[](http://badge.fury.io/rb/responders)
|
4
|
-
[](http://travis-ci.org/
|
5
|
-
[](https://codeclimate.com/github/
|
4
|
+
[](http://travis-ci.org/heartcombo/responders)
|
5
|
+
[](https://codeclimate.com/github/heartcombo/responders)
|
6
6
|
|
7
|
-
A set of responders modules to dry up your Rails
|
7
|
+
A set of responders modules to dry up your Rails app.
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
@@ -179,19 +179,21 @@ class InvitationsController < ApplicationController
|
|
179
179
|
end
|
180
180
|
```
|
181
181
|
|
182
|
-
Now you would see the message "name@example.com was successfully created" instead of the default "Invitation was successfully created."
|
182
|
+
Now you would see the message `"name@example.com was successfully created"` instead of the default `"Invitation was successfully created."`
|
183
183
|
|
184
184
|
## Generator
|
185
185
|
|
186
186
|
This gem also includes a responders controller generator, so your scaffold can be customized
|
187
187
|
to use `respond_with` instead of default `respond_to` blocks. From 2.1, you need to explicitly opt-in to use this generator by adding the following to your `config/application.rb`:
|
188
188
|
|
189
|
-
|
189
|
+
```ruby
|
190
|
+
config.app_generators.scaffold_controller :responders_controller
|
191
|
+
```
|
190
192
|
|
191
193
|
## Failure handling
|
192
194
|
|
193
195
|
Responders don't use `valid?` to check for errors in models to figure out if
|
194
|
-
the request was
|
196
|
+
the request was successful or not, and relies on your controllers to call
|
195
197
|
`save` or `create` to trigger the validations.
|
196
198
|
|
197
199
|
```ruby
|
@@ -219,7 +221,7 @@ end
|
|
219
221
|
## Verifying request formats
|
220
222
|
|
221
223
|
`respond_with` will raise an `ActionController::UnknownFormat` if the request
|
222
|
-
|
224
|
+
MIME type was not configured through the class level `respond_to`, but the
|
223
225
|
action will still be executed and any side effects (like creating a new record)
|
224
226
|
will still occur. To raise the `UnknownFormat` exception before your action
|
225
227
|
is invoked you can set the `verify_requested_format!` method as a `before_action`
|
@@ -251,6 +253,6 @@ Want more examples ? Check out these blog posts:
|
|
251
253
|
|
252
254
|
If you discover any bugs or want to drop a line, feel free to create an issue on GitHub.
|
253
255
|
|
254
|
-
http://github.com/
|
256
|
+
http://github.com/heartcombo/responders/issues
|
255
257
|
|
256
|
-
MIT License. Copyright 2009-2019 Plataformatec.
|
258
|
+
MIT License. Copyright 2020 Rafael França, Carlos Antônio da Silva. Copyright 2009-2019 Plataformatec.
|
@@ -190,7 +190,7 @@ module ActionController #:nodoc:
|
|
190
190
|
# 2. <tt>:action</tt> - overwrites the default render action used after an
|
191
191
|
# unsuccessful html +post+ request.
|
192
192
|
# 3. <tt>:render</tt> - allows to pass any options directly to the <tt>:render<tt/>
|
193
|
-
# call after unsuccessful html +post+ request.
|
193
|
+
# call after unsuccessful html +post+ request. Useful if for example you
|
194
194
|
# need to render a template which is outside of controller's path or you
|
195
195
|
# want to override the default http <tt>:status</tt> code, e.g.
|
196
196
|
#
|
@@ -128,7 +128,7 @@ module Responders
|
|
128
128
|
return if controller.flash[status].present?
|
129
129
|
|
130
130
|
options = mount_i18n_options(status)
|
131
|
-
message = Responders::FlashResponder.helper.t options[:default].shift, options
|
131
|
+
message = Responders::FlashResponder.helper.t options[:default].shift, **options
|
132
132
|
set_flash(status, message)
|
133
133
|
end
|
134
134
|
|
data/lib/responders/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: responders
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- José Valim
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '5.0'
|
41
41
|
description: A set of Rails responders to dry up your application
|
42
|
-
email:
|
42
|
+
email: heartcombo@googlegroups.com
|
43
43
|
executables: []
|
44
44
|
extensions: []
|
45
45
|
extra_rdoc_files: []
|
@@ -62,7 +62,7 @@ files:
|
|
62
62
|
- lib/responders/locales/en.yml
|
63
63
|
- lib/responders/location_responder.rb
|
64
64
|
- lib/responders/version.rb
|
65
|
-
homepage: https://github.com/
|
65
|
+
homepage: https://github.com/heartcombo/responders
|
66
66
|
licenses:
|
67
67
|
- MIT
|
68
68
|
metadata: {}
|
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
requirements: []
|
84
|
-
rubygems_version: 3.
|
84
|
+
rubygems_version: 3.1.2
|
85
85
|
signing_key:
|
86
86
|
specification_version: 4
|
87
87
|
summary: A set of Rails responders to dry up your application
|