title: How to make radio button checked by default based on different user role?
body: <pre><code>&lt;% if role.name == "Administrator" %&gt;
       &lt;%= f.radio_button:status,'available', :checked =&gt; (params[:status] == nil ? true : params[:status]) %&gt;&lt;label&gt;Available&lt;/label&gt;
       &lt;%= f.radio_button:_status,'not available' %&gt;&lt;label&gt;Not Available&lt;/label&gt;
  &lt;% else %&gt;
       &lt;%= f.radio_button:_status,'available' %&gt;&lt;label&gt;Available&lt;/label&gt;
       &lt;%= f.radio_button:_status,'not available' %&gt;&lt;label&gt;Not Available&lt;/label&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>By default i want the <code>available</code> radio button to be checked in case of administrator and <code>not available</code> radio button for rest of user. But he can change it and when viewing for editing it should show the one he/she has selected and not the default one.</p>
  
  <p>How can i do this? please help me.</p>