<% if role.name == "Administrator" %>
<%= f.radio_button:status,'available', :checked => (params[:status] == nil ? true : params[:status]) %><label>Available</label>
<%= f.radio_button:_status,'not available' %><label>Not Available</label>
<% else %>
<%= f.radio_button:_status,'available' %><label>Available</label>
<%= f.radio_button:_status,'not available' %><label>Not Available</label>
<% end %>
By default i want the available radio button to be checked in case of administrator and not available 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.
How can i do this? please help me.