这个问题在我的 rails 应用程序中...文本输入框很大,而不仅仅是行输入框。
在 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
巨大的特工盒
这个问题也发生在我的登录页面上,我的电子邮件字段也很大。我该如何解决这个问题?
谢谢
您应该
将as
选项f.input
与类似 -
f.input :servesCuisine, as: :string
f.input :description, as: :string
您可以编辑admin_users.rb
文件
f.input :email, as: :string
希望这有帮助!!
LHH 是 100% 正确的,但是如果你需要更多的控制但又不想涉及 CSS,你可以这样做:
f.input :title, label: 'Title tag', input_html: {cols: "5", rows: "1"}