r404 1.0.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +11 -1
- data/app/controllers/concerns/{r404_controller.rb → r404_renderer.rb} +1 -1
- data/app/controllers/r404_controller.rb +11 -0
- data/lib/r404/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6087b1524bee4fc34554fa3c87b6bfe5da7180bc9c5da2aa1718cc5717e41fd7
|
4
|
+
data.tar.gz: e0e556d4df6ec622bad2ee8241c4b32c659f00a513ef4c7804127972ccc7c18e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 679be1189425e83112d8ac943f1324a4cbd9dc92afd3a8d6603b95e12345c7057b4f98e8bf47d33f02d89c5844b8ea35bb83275ece5fea7c193086586a70417d
|
7
|
+
data.tar.gz: 47f6dc3f6afaf77fee47bd5b80a4e748dd279111d9d53397b0c5904e7c7387b333c4694380af99e9654e3e01d4b8b8f3fa40af19ed587b57e4369eade4fb681f
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -48,7 +48,7 @@ Now run the generator:
|
|
48
48
|
|
49
49
|
$ rails g r404
|
50
50
|
|
51
|
-
Finally add `include
|
51
|
+
Finally add `include R404Renderer` to your `ApplicationController` located in `app/controllers/application_controller.rb`.
|
52
52
|
|
53
53
|
---
|
54
54
|
|
@@ -106,6 +106,16 @@ rescue_from ActiveRecord::RecordNotFound, AbstractController::ActionNotFound, Ac
|
|
106
106
|
end
|
107
107
|
```
|
108
108
|
|
109
|
+
### Routing errors
|
110
|
+
|
111
|
+
Often you want to raise `R404::NotFound` errors for every undefined route. Using r404 controller actions, add the following to the very bottom of your routes:
|
112
|
+
|
113
|
+
```ruby
|
114
|
+
match '*path', to: 'r404#not_found', via: :all
|
115
|
+
```
|
116
|
+
|
117
|
+
**Note:** Similar actions are also available for every other r404 error class.
|
118
|
+
|
109
119
|
### List of all error classes
|
110
120
|
|
111
121
|
* `R404::AccessDenied` (`:access_denied`, `403`)
|
data/lib/r404/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: r404
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Hübotter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -89,7 +89,8 @@ files:
|
|
89
89
|
- CHANGELOG.md
|
90
90
|
- LICENSE
|
91
91
|
- README.md
|
92
|
-
- app/controllers/concerns/
|
92
|
+
- app/controllers/concerns/r404_renderer.rb
|
93
|
+
- app/controllers/r404_controller.rb
|
93
94
|
- app/helpers/r404_helper.rb
|
94
95
|
- lib/generators/r404_generator.rb
|
95
96
|
- lib/generators/templates/access_denied.html.erb
|