java:new.html.erb
<select>
<option>Veuillez sélectionner un utilisateur avec qui discuter</option>
<option>Utilisateur 1</option>
<option>Utilisateur 2</option>
</select>
java:new.html.erb
<div class="mentors-detail">
<div class="form">
<div class="weight-bold-text">
compétence
<span class="indispensable">Obligatoire</span>
</div>
<%= f.collection_select(:skill_id, Skill.all, :id, :name, {}, {class:"select-box", id:"mentor-skill"}) %>
</div>
skill_id.rb
class Skill < ActiveHash::Base
self.data = [
{ id: 1, name: '--' },
{ id: 2, name: 'HTML•CSS' },
{ id: 3, name: 'Ruby' },
{ id: 4, name: 'Javascript' },
{ id: 5, name: 'PHP' },
{ id: 6, name: 'Python' },
{ id: 7, name: 'SQL' },
{ id: 8, name: 'GO' },
]
end
new.css
.mentors-detail {
display: flex;
justify-content: space-between;
padding: 2vh 0;
}
.mentors-detail>.form {
width: 300px;
padding: 2vh 0;
}
.select-box {
margin: 2vh 0;
}
Recommended Posts