[英]Simple_form inputs are too long
與Ruby on Rails一樣,我使用simple_form gem以更優雅,更簡單的方式處理表單。 但是我有這個問題,字符串輸入不能正確生成。 我的意思是它們按預期工作,但它們卻非常長,就像完全不在我的屏幕上一樣。 這不是正常行為嗎? 我應該為此應用任何特殊的CSS嗎? 也許還有其他解決方案?
我有這樣的形式:
= simple_form_for @book, url: books_path, method: :post do |f|
= f.input :title, label: false, placeholder: "title"
= f.input :author, label: false, placeholder: "author"
= f.input :isbn, label: false, placeholder: "ISBN"
= f.input :publishing_date, label: false, placeholder: "Publishing date"
= f.input :amount, label: false, placeholder: "Amount"
= f.submit class: "btn btn-success"
除此之外,我只是將'gem“ simple_form”“放入Gemfile,就這樣。
通過鍵入simple_form width我發現了一個很好的答案:
{:maxlength => 2,:style =>'width:20px'}%>從這個答案:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.