Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Select tag doesn't display on my form

I'm writing a really simple form with 2 text fields and one select. For some reason, the select tag with options doesn't display on my page. I can see the 2 text fields and the label for the the select, but not the select it self. The app is written in rails and I use materialize.

There might be something too obvious that I don't see it, but after 30mn of thinking, I guess it's fair to put it on SO :) Thanks

Here's the code:

<form action="/resources" method="post">

  <input
  type="hidden"
  name="authenticity_token"
  value="<%= form_authenticity_token %>">

  <label for="ressource_name">Ressource Name</label>
  <input type="text" id="ressource_name" name="resource[ress_name]" value="<%= @resource.ress_name %>">

  <label for="ressource_link">Ressource Link</label>
  <input type="text" id="ressource_link" name="resource[link]" value="<%= @resource.link %>">


  <label for="categories">Categories</label>
  <select id="categories" name="resource[category_id]">
    <option value="1">Stuff 1</option>
    <option value="2">Stuff 2</option>
    <option value="3">Stuff 3</option>
    <option value="4">Stuff 4</option>
    <option value="5">Stuff 5</option>
    <option value="6">Stuff 6</option>
    <option value="7">Stuff 7</option>
    <option value="8">Stuff 8</option>
  </select>
  <br>
  <input type="submit" value="Post">
</form>
like image 984
Stan Amsellem Avatar asked Dec 08 '22 22:12

Stan Amsellem


1 Answers

So I put the answer (from Samir) here as well as I guess some other people might come across that issue (it won't change your life, but it might save you some minutes that you want to spend on 'real' issues).

Check the styling! For some reason the select tag was defaulted to {display: none;}

like image 151
Stan Amsellem Avatar answered Dec 25 '22 09:12

Stan Amsellem