Radio buttons in forms

<% form_for @group do |g| %>

To create a new group please complete the details below

    <label> Group Name </label>
    <%= g.text_field :name %>

    <label> Public </label>
    <%= g.radio_button :type, "public" %>
    <label> Private </label>
    <%= g.radio_button :type, "private" %>
    <label> Secret </label>
    <%= g.radio_button :type, "secret" %>

<%= submit_tag(value = "Create group") %>

<% end %>

above is the code in my view, in my group model i defined :type as
null => false
when i click on the create button a get an error, Validation failed
Type cant be blank.

Is there anything wrong the way I created my radio-buttons ? Because I
assume they do not assign the value to :type


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