Validate_presence_of radio button selected?

Hi,

I’m trying to force a user to pick one of several options, but
validate_presence_of doesn’t seem to work on my radio buttons. Has
anyone else had this problem?

##Model
validates_presence_of :category_id

##View

<% category_list.each do |cat| %>
<%= radio_button (:video, :category_id, cat.id) %>

<%= cat.name %>



<% end %>

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs