Question

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' %> 
Was it helpful?

Solution

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" %>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top