I\'m using Ruby on Rails 3 to create a form for the user, where he can save his birthdate. All the actions around the controller and model work just fine. But I\'m having tr
I had a similar problem but I wanted each select box to have its own class.
Here's what I did (using ERB not HAML):
<%= select_month(@person.birthday, field_name: "birthday(2i)", prefix: "person", prompt: true) %>
<%= select_day(@person.birthday, field_name: "birthday(3i)", prefix: "person", prompt: true) %>
<%= select_year(@person.birthday, field_name: "birthday(1i)", prefix: "person", start_year: Date.today.year, end_year: 1905, prompt: true) %>
Then I was able to wrap each in a div with the proper class but you could also add classes directly to the select tags like this:
<%= select_month(@person.birthday, {field_name: "birthday(2i)", prefix: "person", prompt: true}, class: "class_name") %>