miklki14567
miklki14567

Reputation: 149

Where do I insert a class?

I'm new to rails and I'm pretty confused on where to put my class:'custom-select' for a select option.

<%= form.select(:category_id, options_for_select(@categories)) %>

Where does it go?

Thank you ahead of time.

Upvotes: 0

Views: 73

Answers (1)

mccalljt
mccalljt

Reputation: 796

The HTML hash is the fourth argument in the select tag helper method.

<%= form.select(:category_id, options_for_select(@categories), {}, class: 'custom-select') %>

Upvotes: 2

Related Questions