supersize supersize - 6 months ago 60
Ruby Question

ActiveAdmin renders datatype text as textarea in its forms

My model consists of a couple rows with datatype

text
. Unfortunately ActiveAdmin seem to render these as a
<textarea>
. I would like to have them as an
<input type="text">
but I cannot make it to work. My attempt so far:

form do |f|
inputs do
f.input :name, as: :text
f.input :name, input_html: { type: "text" }
end
end


Any idea how I can render datatype
text
row as a standard input, not as a textarea in ActiveAdmin?

Thanks

Answer
form do |f|
  inputs do
    f.input :name, as: :string
  end
end
Comments