Simple_form I get No input found for citext

I have basic text input in simple_form:

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

I get this exception when I try to display the view:

 No input found for citext 

How can I solve it?

+5
source share
2 answers

Just specify the input type:

 = f.input :title, label: "Name:", placeholder: "New make", as: :string 
+5
source

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

 SimpleForm::FormBuilder.map_type :citext, to: SimpleForm::Inputs::TextInput 
+4
source

Source: https://habr.com/ru/post/1247893/


All Articles