r404 1.0.1 → 2.0.0

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: 6c50669df13ac9b55b848e9f2fa915b35d9aece01232a13c7d0dec68af65b8bb
4
- data.tar.gz: a10ec7157a3f5c5d974b58508cb8af41221978c00686ac3b4af72d9e99347fb9
3
+ metadata.gz: 6087b1524bee4fc34554fa3c87b6bfe5da7180bc9c5da2aa1718cc5717e41fd7
4
+ data.tar.gz: e0e556d4df6ec622bad2ee8241c4b32c659f00a513ef4c7804127972ccc7c18e
5
5
  SHA512:
6
- metadata.gz: 7215b5965a53a53d9944507829001e3ede0a8ce88a9c89af445fc99cd678f9ab3dcc8ac4d5028d9eac4db70620d5ead1be969c13f538746beaa33e84675600f9
7
- data.tar.gz: 6458ecc9da58f8b2319650ea69c5f15cd37abf2d58591d47fbec4798c8297c76304f1f4917dba24e3e571ce6cf96efa55cf0b478cb4a36bed444e4aa3be830dc
6
+ metadata.gz: 679be1189425e83112d8ac943f1324a4cbd9dc92afd3a8d6603b95e12345c7057b4f98e8bf47d33f02d89c5844b8ea35bb83275ece5fea7c193086586a70417d
7
+ data.tar.gz: 47f6dc3f6afaf77fee47bd5b80a4e748dd279111d9d53397b0c5904e7c7387b333c4694380af99e9654e3e01d4b8b8f3fa40af19ed587b57e4369eade4fb681f
@@ -4,6 +4,11 @@
4
4
 
5
5
  * nothing yet
6
6
 
7
+ ### 2.0.0 - 2018/01/27
8
+
9
+ * features
10
+ * allowed routing to r404 errors
11
+
7
12
  ### 1.0.1 - 2018/01/26
8
13
 
9
14
  * bugfixes
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 R404Controller` to your `ApplicationController` located in `app/controllers/application_controller.rb`.
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`)
@@ -1,4 +1,4 @@
1
- module R404Controller
1
+ module R404Renderer
2
2
 
3
3
  extend ActiveSupport::Concern
4
4
 
@@ -0,0 +1,11 @@
1
+ class R404Controller < ApplicationController
2
+
3
+ def access_denied
4
+ r404 :access_denied
5
+ end
6
+
7
+ def not_found
8
+ r404 :not_found
9
+ end
10
+
11
+ end
@@ -1,5 +1,5 @@
1
1
  module R404
2
2
 
3
- VERSION = '1.0.1'
3
+ VERSION = '2.0.0'
4
4
 
5
5
  end
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: 1.0.1
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-26 00:00:00.000000000 Z
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/r404_controller.rb
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