Exception: ActionView::WrongEncodingError
- Inherits:
-
EncodingError
- Object
- StandardError
- EncodingError
- ActionView::WrongEncodingError
- Defined in:
- actionpack/lib/action_view/template/error.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(string, encoding) ⇒ WrongEncodingError
constructor
A new instance of WrongEncodingError.
- #message ⇒ Object
Constructor Details
#initialize(string, encoding) ⇒ WrongEncodingError
Returns a new instance of WrongEncodingError.
13 14 15 |
# File 'actionpack/lib/action_view/template/error.rb', line 13 def initialize(string, encoding) @string, @encoding = string, encoding end |
Instance Method Details
#message ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'actionpack/lib/action_view/template/error.rb', line 17 def @string.force_encoding("BINARY") "Your template was not saved as valid #{@encoding}. Please " \ "either specify #{@encoding} as the encoding for your template " \ "in your text editor, or mark the template with its " \ "encoding by inserting the following as the first line " \ "of the template:\n\n# encoding: <name of correct encoding>.\n\n" \ "The source of your template was:\n\n#{@string}" end |