title: Ruby on rails - How can check a radio button, created by simple form, is checked in controller?
body: <p>I built an view to create question and answer. This is my Question and Answer model:</p>
  
  <pre><code>class Question &lt; ActiveRecord::Base
    attr_accessible :content
  
    belongs_to :topic
    belongs_to :user
    belongs_to :question_type
    has_many :answers, dependent: :destroy
    accepts_nested_attributes_for :answers
  end
  
  class Answer &lt; ActiveRecord::Base
    attr_accessible :content
  
    belongs_to :question
  end
  </code></pre>
  
  <p>My answer model also have a attribute called <code>correct</code> type boolean to set true if which answer is correct, default is false. I have built a form to create a True/False question:</p>
  
  <pre><code>&lt;%= simple_form_for @question do |q| %&gt;
  
    &lt;%= q.input :content, input_html: { rows: 3, class: 'span6' } %&gt;
    &lt;%= q.input :mark, input_html: { class: 'span1' } %&gt;
    &lt;%= q.association :topic %&gt;
    &lt;%= q.association :question_type %&gt;
  
    &lt;%= q.simple_fields_for :answers do |a| %&gt;
  
      &lt;%= a.input :correct, collection: [[true, 'True'], [false, 'False']],
                                                              as: :radio_buttons,
                                                              label: 'Answer',
                                                              value_method: :first,
                                                              label_method: :last,
                                                              item_wrapper_class: 'inline'
                                                              %&gt;
  
    &lt;% end %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>The correct attribute when rendered in view have these html:</p>
  
  <pre><code>&lt;label class="radio inline"&gt;&lt;input class="radio_buttons optional" id="question_answers_attributes_0_correct_true" name="question[answers_attributes][0][correct]" type="radio" value="true"&gt;True&lt;/label&gt;
  
  &lt;label class="radio inline"&gt;&lt;input checked="checked" class="radio_buttons optional" id="question_answers_attributes_0_correct_false" name="question[answers_attributes][0][correct]" type="radio" value="false"&gt;False&lt;/label&gt;
  </code></pre>
  
  <p>Now in controller i want to check which radio button is checked and its value. Is there any method to check if <code>correct</code> attribute is checked and its value in controller?</p>