Add “# coding: utf-8” to all files

前端 未结 1 1005
难免孤独
难免孤独 2020-12-06 01:43

Can I somehow configure Rails to avoid the need to add # coding: utf-8 to all files? Or must I add it to each file manually?

UPD

<
相关标签:
1条回答
  • 2020-12-06 02:24

    In a rails application you can specify the default chracter encoding in your application config.

    Add the following code inside the Application class in in config/application.rb

    Looks something like:

    # Configure the default encoding used in templates for Ruby 1.9.
    config.encoding = "utf-8"
    
    0 讨论(0)
提交回复
热议问题