0

I have the following for:

<%= form_for Ggroup.new, url: what_to_do_files_path ,method: :get ,:validate => true do |f| %>
<div class="field_label">
<%= f.label :group_name%>
</div>
<div class="field">
<%=f.text_field :group_name %>
</div>
<%= button_tag :class => "btn btn-primary", :name => 'submit' do %> Submit <% end %>
lalala
<%end%>

So I have following structure: Group name the field for typing.
I would like to have the label inside the the field for typing. So that the words "Group name" would be not near the text field but inside it and the user will type his group name there. Thanks in advance.

1 Answer 1

1

Actually, the name of the functionality you are looking for is placeholder. You can implement a placeholder for textfield like this,

<%=f.text_field :group_name, placeholder: "Group Name" %>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.