Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple Form Blank Label

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.

like image 875
Mini John Avatar asked Jul 04 '13 23:07

Mini John


3 Answers

Have you tried label:false instead of label:"":

<%= f.input :email, class: "login-field", label: false %>
like image 131
vee Avatar answered Nov 13 '22 21:11

vee


Old question but it worked for me, @Josh M:

<%= f.input :email, class: "login-field", label: '&nbsp;'.html_safe %>

simple_form (3.0.2)

like image 39
JoseLuis Torres Avatar answered Nov 13 '22 21:11

JoseLuis Torres


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.

like image 41
Mike Szyndel Avatar answered Nov 13 '22 20:11

Mike Szyndel