Как добавить значок после метки в оболочке simple_form - PullRequest
0 голосов
/ 01 марта 2020

Я работаю с rails 6.0 и не использую boostrap

Я хотел бы добавить значок (fa fa-question-circle) сразу после метки, только если имеется подсказка ,

<%= f.simple_fields_for :profile, wrapper: :custom_form do |profile| %> 
  <div class="field field--with-hint">
    <%= profile.input :twitter %>
  </div>
<% end %>

и подсказка должна отображаться только при наведении курсора на иконку (если имеется).

simple_form_wrapper :
  config.wrappers :custom_form, tag: 'div', class: 'field', hint_class: 'field--with-hint', error_class: 'field--with-errors' do |b|
    # b.use :html5
    b.use :placeholder
    b.use :label, class: 'label'
    b.use :hint,  wrap_with: { tag: 'p', class: 'hint hint-hover total-flex' }
    b.use :input, class: 'input'
    b.use :error, wrap_with: { tag: 'span', class: 'error' }
  end

Как мне обновить эту оболочку, чтобы сделать это?

...