rails_fix_google_bot_accept 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +2 -0
- data/lib/rails_fix_google_bot_accept.rb +1 -1
- data/lib/rails_fix_google_bot_accept/version.rb +1 -1
- metadata +3 -4
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# RailsFixGoogleBotAccept
|
2
2
|
|
3
3
|
This gem fixes the `ActionView::MissingTemplate` error generated by Rails when a page is requested with the header `Accept: */*;q=0.9` (or any other number).
|
4
|
+
|
4
5
|
The Google bot does such requests.
|
5
6
|
|
6
7
|
## Installation
|
@@ -18,6 +19,7 @@ That's it.
|
|
18
19
|
## Source
|
19
20
|
|
20
21
|
The gem is based on this gist: https://gist.github.com/2590040/93cb2faca1ba5ead73222e74ca11790e3efb22de
|
22
|
+
|
21
23
|
It was made by Romain Champourlier as an answer to this question: http://stackoverflow.com/questions/8881756/googlebot-receiving-missing-template-error-for-an-existing-template
|
22
24
|
|
23
25
|
## Contributing
|
@@ -23,7 +23,7 @@ module RailsFixGoogleBotAccept
|
|
23
23
|
# If the request 'Content Accept' header indicates a '*/*' format,
|
24
24
|
# we set the format to :html.
|
25
25
|
# This is necessary for GoogleBot which requests / with '*/*;q=0.6' for example.
|
26
|
-
if env["HTTP_ACCEPT"] =~ %r
|
26
|
+
if env["HTTP_ACCEPT"] =~ %r%\A\*/\*;q=\d\.\d\Z%
|
27
27
|
env["HTTP_ACCEPT"] = '*/*'
|
28
28
|
end
|
29
29
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_fix_google_bot_accept
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-03-06 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: Rails fix for Google bot requests
|
16
16
|
email:
|
@@ -49,10 +49,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
49
49
|
version: '0'
|
50
50
|
requirements: []
|
51
51
|
rubyforge_project:
|
52
|
-
rubygems_version: 1.8.
|
52
|
+
rubygems_version: 1.8.23
|
53
53
|
signing_key:
|
54
54
|
specification_version: 3
|
55
55
|
summary: ! 'This gem fixes the `ActionView::MissingTemplate` error generated by Rails
|
56
56
|
when a page is requested with the header `Accept: */*;q=0.9` (or any other number).'
|
57
57
|
test_files: []
|
58
|
-
has_rdoc:
|