だから私は尋ねるようになるでしょう。Railsのsimple_formコレクションを%ulに変換しますか?
これは私のsimple_form
= f.input :focus, collection: [[t('alg.focus.execution'), 'Execution'], [t('alg.focus.management'), 'Management'], [t('alg.focus.client'), 'Client'], [t('alg.focus.development'), 'Development']], :wrapper => :inline_checkbox, :include_blank => false, label: t('recruiter.jobs.new.focus')
とHTMLでの出力から入力された今、私が何をしたいのか
<div class="select required job_focus">
<select class="select required" name="job[focus]" id="job_focus">
<option value="Execution">Execuție</option>
<option value="Management">Management</option>
<option value="Client">Client</option>
<option value="Development">Dezvoltare</option></select></div>
この
ある がULにタグを選択変更することです オプションを lに設定すると、この方法でドロップダウンメニューをカスタマイズできます。simple_formの方法を見つけました。タグにラッパークラスを追加したり、他のタグではなく別のタグを使用したりすることができますが、入力、ラベル、エラーなどのタグに限られています。しかし、私は選択とオプションを変更する方法を見つけることができませんでした。入力:wrapper => :inline_checkbox,
にこの要素を追加することによって、およびsimple_form.rbにこれを追加することにより、
このconfig.wrappers :inline_checkbox, :error_class => 'error' do |b|
b.use :html5
b.use :input
b.use :label
b.wrapper :tag => 'div', :class => 'controls' do |ba|
ba.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' }
ba.use :hint, :wrap_with => { :tag => 'p', :class => 'help-block' }
end
end
は、だから私はあなたの助けを必要としています。 ありがとうございます。
選択は、スタイルに難しいです。あなたはおそらくhttps://github.com/argerim/select2-railsを探しています –