4

I Have a code in my project like

<div class="form-inputs">
  <%= f.input :twitter %>
</div>

It gives label as Twitter in my website. How it produce label with out giving label parameter. I want to change label to something else like Tweet it.

0

1 Answer 1

6

You can add label in very simple way

<%= f.input :twitter, label: 'Tweet it' %>

Check this simple_form usage

If you want to disable label

<%= f.input :input_field_name, label: false %>

Add custom class to label

<%= f.input :field_name, label_html: { class: 'my_class' } %>
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.