Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Active Admin Text Input are Big Instead of just a line

this problem is across my rails app... The text input boxes are huge instead of simply being line ones.

in app/admin/restaurant.rb

form do |f|
  f.inputs do
    f.input :name, required: true
    f.input :servesCuisine
    f.input :description
    f.input :currenciesAccepted, as: :select, collection:Restaurant.available_currencies
    f.input :priceRange, as: :select, collection: Restaurant.price_range
    f.input :paymentAccepted
    f.input :email, as: :email
    f.input :telephone, as: :phone
    f.input :faxNumber, as: :phone
    f.input :longitude
    f.input :latitude
    f.input :image, as: :file
  end
f.actions
end

Huge texbox

The problem also occurs on my login page where my email field is also gigantic. How can I fix this?

Thanks

like image 232
klarriv Avatar asked Sep 02 '25 11:09

klarriv


2 Answers

You should use as option with f.input like -

f.input :servesCuisine, as: :string
f.input :description, as: :string

You can edit your admin_users.rb file

f.input :email, as: :string

Hope this helps!!

like image 190
LHH Avatar answered Sep 06 '25 18:09

LHH


LHH is 100% spot-on, however if you need a bit more control but don't want to involve CSS, you can do:

f.input :title, label: 'Title tag', input_html: {cols: "5", rows: "1"}
like image 24
The Whiz of Oz Avatar answered Sep 06 '25 16:09

The Whiz of Oz