0

I'm currently trying to implement an select_tag, the problem I'm facing is that every css element works, except the select option. Somehow the bootstrap stylesheet gets called when I use f.select :home_type, [["Room", "Room"]], class: 'add-listing__input'

This stylesheet gets called and only select works

http://localhost:3000/assets/triptip-assets.min.self-3157b4719675b23587e706840e28dab5a7506a2794b67521ade419a505a34070.css?body=1

When I use for example f.text_field everything works and this stylesheet gets called

http://localhost:3000/assets/style.self-6fdbeaf8dfea504b6f923ccefbf5f6a7f370c6436cf98feefac201fc92c78f83.css?body=1

EDIT

Here is my form

  <%= form_for @room do |f| %>
    <div class="add-listing__form-content">
      <div class="row">
        <div class="col-md-6">
          <label class="add-listing__label">
            Home Type:
          </label>
          <%= f.select :home_type, [["Wohngebäude", "Wohngebäude"], ["Bürogebäude", "Bürogebäude"], ["Haus", "Haus"], ["Geschäft", "Geschäft"]], class: 'add-listing__input js-example-basic-multiple' %>
        </div>
        <div class="col-md-6">
          <label class="add-listing__label">
            Vacancy Type:
          </label>
          <%= f.select :vacancy_type, [["Leer", "Leer"], ["Voll", "Voll"]], class: 'add-listing__input js-example-basic-multiple' %>
        </div>
      </div>
      <div class="row">
        <div class="col-md-6">
          <label class="add-listing__label">
            Accomodate:
          </label>
          <%= f.number_field :accomodate, id: "amount", placeholder: "Für wie viele Personen?", class: "add-listing__input" %>
        </div>
        <div class="col-md-6">
          <label class="add-listing__label">
            Abrissgerüchte:
          </label>
          <%= f.text_field :rumors, id: "rumors", placeholder: "Abrissgerüchte?", class: "add-listing__input" %>
        </div>
      </div>

    </div>
  <% end %>
2
  • 1
    Can you post your form ? Or just the select tag Commented Jan 17, 2019 at 11:39
  • I added the form Commented Jan 17, 2019 at 13:00

1 Answer 1

3

You should define class in select field in this way:

<%= f.select(:vacancy_type, [ ... ], {}, { class: 'my_style_class' }) %>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.