Cloud Stack Ninja

I cannot seem to find the answer to this.

My tag looks like this:

<%= form.text_field :event_location, :required => true, nil, placeholder: "Location" %>

Which isn't working, and is throwing a syntax error. How do I add a placeholder to my text_field form helper tag?

I've also tried these which also do not work:

<%= form.text_field :event_location, :required => true, "", placeholder: "Location" %>
<%= form.text_field :event_location, :required => true, :placeholder => "Location" %>
<%= form.text_field :event_location, :required => true, :attr, :placeholder => "Location" %>
<%= form.text_field :event_location, :required => true, :attr, "", placeholder: "Location" %>

Read more here:

Content Attribution

This content was originally published by Corey at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: