Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple Form: Is it possible to remove labels and replace them with placeholders using the labels i18n? [duplicate]

I'm trying to produce a regular simpleform form

= simple_form_for [:hq, @team, @order] do |f|
  .tickets
    = f.select :tickets, :aaa => "aaa"
    = render "ticket"


  .details
    .left
      = f.input :address1
      = f.input :address2
      = f.input :state
      = f.input :country
      = f.input :email
    .right
      = f.input :comments

But I want the inputs to not be rendered with a label, just the title "Address Line 1" in the placeholder.

I know I can do this with f.input :address1, :placeholder => "whatever", :label => "" but I'd like it to be configurable with a wrapper and take the i18n value form label, not placeholder.

like image 795
Michael Gall Avatar asked Sep 24 '12 04:09

Michael Gall


1 Answers

Try doing the following:

f.input :address1, placeholder: "Address Line 1", label: false
like image 153
matiasdh Avatar answered Sep 18 '22 00:09

matiasdh