Simple Form Blank Label
21,320
Solution 1
Have you tried label:false
instead of label:""
:
<%= f.input :email, class: "login-field", label: false %>
Solution 2
Old question but it worked for me, @Josh M:
<%= f.input :email, class: "login-field", label: ' '.html_safe %>
simple_form (3.0.2)
Solution 3
I think the way to go is label: false
Also in simple_form_for
you may pass defaults: {label: false}
to disable label for all fields in this form.
Related videos on Youtube
Author by
Mini John
⚡️Growth Engineer ~ full stack dev ~ build fast, fix later ~ #Data Junkie ~ #Analytics Obsessed. Data & Growth @anyroad
Updated on August 15, 2020Comments
-
Mini John almost 4 years
So im using Simple Form for my Rails App, and i need to get rid of the label on every input that comes with with simple form.
I Tried: <%= f.input :email, class: "login-field", label: "" %> leaving the label blank, but this didn't work.
I'm relatively new to rails, could somebody explain how to achieve this ?
Edit: I'm trying to achieve this format:
<input type="password" class="login-field" value="" placeholder="Password" id="login-pass" />
Thank you.
-
Josh M. over 10 yearsBut I still want the label's container to show up, just without any text inside. I tried
:label => " "
but the shows up! -
Josh Hunter over 8 years@Josh M was missing .html_safe