java:new.html.erb
<select>
<option>Please select a user to chat with</option>
<option>User 1</option>
<option>User 2</option>
</select>
java:new.html.erb
<div class="mentors-detail">
<div class="form">
<div class="weight-bold-text">
skill
<span class="indispensable">Mandatory</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