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归因
不隶属于 StackOverflow
scroll top