user2498890
user2498890

Reputation: 1566

Ruby on Rails - simple_form - How do I change an input into a multiple choice dropdown?

So I currently have a simple_form set up and one of my inputs is:

<%= form.input :contract, input_html: { maxlength: 60 }, placeholder: "Contract Type", label: false %> 

However I would instead like to change it into a dropdown with 3 options - full time, part time and internship.

What is the correct way to achieve this?

Upvotes: 0

Views: 408

Answers (1)

pkrawat1
pkrawat1

Reputation: 681

try this

<%= form.input :contract, collection: ['full time', 'part time', 'internship'], input_html: { class: "ui dropdown", maxlength: 60, }, prompt: "Contract Type", label: false %> 

Upvotes: 1

Related Questions