LoginSignup
8
9

More than 5 years have passed since last update.

YAMLでクォート `'` をエスケープする

Posted at

Railsでi18nする時に en.ymlとか ja.ymlとか使うわけですが、このYAMLファイルの中で'を使おうと思ってこんなふうに書くとエラーになります。

en.yml
  do_not_do_it: 'don\'t do it.'

quoteのエスケープは

en.yml
  do_not_do_it: 'don''t do it.'

になります。

参考

8
9
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
9