Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add a class to a selectbox in Rails 3 [duplicate]

I cannot figure out how to add a class to this select box in Rails 3.

<%= select(:item, :item_type, [['Phone', 1], ['Email', 2], ['Website', 3], ['Address', 4], ['Occupation', 5]]) %>

Is there anyone that knows how to do it?

like image 469
Jonathan Clark Avatar asked Dec 01 '22 09:12

Jonathan Clark


1 Answers

Here's the official documentation for the select helper

<%= select(:item, :item_type, [['Phone', 1], ['Email', 2], ['Website', 3], ['Address', 4], ['Occupation', 5]], {}, :class => "myclass") %>
like image 130
Simone Carletti Avatar answered Dec 05 '22 03:12

Simone Carletti