Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

simple_form I'm getting No input found for citext

I have a basic text input in the simple_form:

= f.input :title, label: "Name:", placeholder: "New make"

I fetch this exception when I'm trying to render the view:

No input found for citext

How can I solve it?

like image 556
asiniy Avatar asked Apr 25 '16 17:04

asiniy


Video Answer


2 Answers

Just specify input type:

= f.input :title, label: "Name:", placeholder: "New make", as: :string
like image 109
asiniy Avatar answered Oct 27 '22 01:10

asiniy


You can also put following line in the initializer to define custom input mappings.

SimpleForm::FormBuilder.map_type :citext, to: SimpleForm::Inputs::TextInput
like image 39
Yeonho Avatar answered Oct 27 '22 01:10

Yeonho