Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change label of simple form input

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.

like image 702
Hfyuu Avatar asked Oct 11 '25 17:10

Hfyuu


1 Answers

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' } %>

Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!