error_page_assets 0.2 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -16
- data/lib/error_page_assets/railtie.rb +1 -1
- data/lib/error_page_assets/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 124bf32583398dfd8afad86645d228d7e5552961
|
4
|
+
data.tar.gz: e55014a4b7db6f5e65c7ca0da1d0ba090b170544
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 231d1e42ff25a46877b9474502b8e72767461af1468e902bac02dd04540547d1070c467d714b373d221f2437d108dff823615326c5a6ba800b85460b2608d248
|
7
|
+
data.tar.gz: 3da2cc64341c6062ef7d13fd7f0fd8792198cc0cf8240395ba3f9756278b7641ce544bc653afa44a0774e91e1154e5761b4b5713d40b2dd4580796c9b1f69dcd
|
data/README.md
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# Error Page Assets
|
2
2
|
|
3
|
-
|
3
|
+
Generate your static error pages with the asset pipeline.
|
4
4
|
|
5
|
-
This gem lets you include Sprockets-generated CSS and JS files
|
6
|
-
complete with cache-busting digests
|
5
|
+
This gem lets you include Sprockets-generated CSS and JS files --
|
6
|
+
complete with cache-busting digests -- in `public/404.html` and friends.
|
7
7
|
You can even use layouts.
|
8
|
+
No monkeypatching, no Rails engines, no routing, just idiomatic asset pipeline code.
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
web server shows your custom error pages even when your app is down hard.
|
10
|
+
`rake assets:precompile` generates static files so your webserver will respond
|
11
|
+
even when your application is down hard.
|
12
12
|
|
13
13
|
|
14
14
|
## Installation
|
@@ -34,6 +34,8 @@ In `config/application.rb`:
|
|
34
34
|
config.assets.precompile += %w[404.html 422.html 500.html]
|
35
35
|
```
|
36
36
|
|
37
|
+
That's it!
|
38
|
+
|
37
39
|
|
38
40
|
## Usage
|
39
41
|
|
@@ -41,17 +43,13 @@ Whenever assets are precompiled (i.e. during each deploy),
|
|
41
43
|
your error pages will be generated and saved in `/public`.
|
42
44
|
|
43
45
|
```sh
|
44
|
-
|
45
|
-
|
46
|
-
# (public/404.html is your newest code)
|
46
|
+
$ rails assets:precompile
|
47
|
+
copy public/assets/404-1c763a81450.html to public/404.html
|
47
48
|
```
|
48
49
|
|
49
|
-
Your error pages are automatically generated along with the
|
50
|
-
rest of your assets each time you deploy.
|
51
|
-
|
52
50
|
### Rails Helpers
|
53
51
|
|
54
|
-
|
52
|
+
Here's an example of using Rails helpers:
|
55
53
|
|
56
54
|
```erb
|
57
55
|
old:
|
@@ -76,6 +74,7 @@ static error pages to use layouts too, use the
|
|
76
74
|
* Do we still need to use digest:true?
|
77
75
|
* Use an initializer to automatically add error pages to the sprockets config?
|
78
76
|
* Rails generator to move your error pages?
|
77
|
+
* I haven't bothered with `I18n.available_locales`/`404.es.html`. If you'd like localization, please file an issue.
|
79
78
|
|
80
79
|
|
81
80
|
## Alternatives
|
@@ -92,8 +91,5 @@ Pain-free MIT.
|
|
92
91
|
|
93
92
|
## Contributing
|
94
93
|
|
95
|
-
My app isn't localized so I haven't bothered with `I18n.available_locales`.
|
96
|
-
If you want localization, please file an issue.
|
97
|
-
|
98
94
|
To make this gem less imperfect, please submit your issues and patches on
|
99
95
|
[GitHub](https://github.com/bronson/error_page_assets/).
|