简体   繁体   English

如何在Rails表单上的占位符文本中显示撇号

[英]How can I show an apostrophe in the placeholder text on a rails form

I want have my form have a placeholder like 我想让我的表单有一个占位符,例如

Please enter the store's address 请输入商店地址

How can I edit the form below to get the apostrophe to work? 如何编辑下面的表格以使撇号生效?

<%= text_area_tag 'store', '', class: 'form-control', placeholder: 'Please enter the store's address' %> 

You can escape apostrophe with backslash: 您可以使用反斜杠转义撇号:

<%= text_area_tag 'store', '', class: 'form-control', placeholder: 'Please enter the store\'s address' %>

or use string literal with quotation marks: 或使用带引号的字符串文字:

<%= text_area_tag 'store', '', class: 'form-control', placeholder: "Please enter the store's address" %>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM