1
votes

I have a Rails form created with simple_form like so:

= simple_form_for @new_biz, url: new_business_post_path, html: {:class => "customForm1", :method => "post"} do |f|

    = f.input :business_name, label: false, :input_html => {:value => @wat.business_name, :readonly => true}
    = f.input :wat_id, :as => :hidden, :input_html => {:value => @wat.id}
    = f.input :first_name
    = f.input :last_name
    = f.input :email
    = f.input :phone, :label => "Phone number"
    = f.label "Personal Message"
    = f.text_area :message, label: false
    = f.submit "Submit"

And validations:

validates :first_name, presence: {:message => "Please enter the first name."}
validates :last_name, presence: {:message => "Please enter the last name."}
validates :phone, presence: {:message => "Please enter the phone number"}
validates :message, presence: {:message => "Please enter a personal message"}

All validations display as expected except for the text_area field. I can't seem to find anyone else who has had this issue. All suggestions are greatly appreciated, thanks.

1

1 Answers

4
votes

shouldn't your text field input be written as:

= f.input :message, as: :text, label: false

?