【问题标题】:How can I show an apostrophe in the placeholder text on a rails form如何在 rails 表单的占位符文本中显示撇号
【发布时间】:2014-06-22 17:07:04
【问题描述】:

我想让我的表单有一个像

这样的占位符

请输入店铺地址

如何编辑下面的表格以使撇号起作用?

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

【问题讨论】:

  • placeholder: '请输入店铺地址'

标签: html ruby-on-rails forms erb


【解决方案1】:

你可以用反斜杠转义撇号:

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

或使用带引号的字符串文字:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-03-16
    • 2015-08-15
    • 2018-10-30
    • 1970-01-01
    • 1970-01-01
    • 2016-10-28
    • 2012-09-25
    • 2019-06-22
    相关资源
    最近更新 更多