Skip to content

Commit 28fc600

Browse files
committed
Update README.md
1 parent b75208c commit 28fc600

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,17 @@ You can pass an custom exception lambda to the ```force_format_filter``` method
9393
force_format_filter :for => :html, :exception => lambda { |msg| raise(MyApp::AwesomeException.new(msg)) }
9494
end
9595

96+
97+
#### Widcard accept header
98+
99+
If an user agent sets the accept header wildcard like ```*/*``` ```force_format_filter``` would fallback
100+
and set the ```request.format``` to *:html*. This is important for access via ```curl``` and I think for the
101+
google bot too. If you don't want this behaviour of wildcard rewriting you can set the ```:skip_wildcard``` option.
102+
103+
class PagesController < ApplicationController
104+
force_format_filter :for => :html, :skip_wildcard => true
105+
end
106+
96107
NOTE: Call the method ```force_format_filter``` only once per controller!
97108
If you call it multiple times, the last one would be used.
98109

0 commit comments

Comments
 (0)