KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Given a radio button like so: <%= radio_button_tag 'permission[role_id]', '2' %> How can I make the radio buttons checked status condition. To only be checked if @permission.role_id.nil? or if @permission.role_id == 2? I tried: <%= radio_button_tag 'permission[role_id]', '2', @permission.role_id.nil? ? {:checked => true} : {:checked => false} %> Thanks
Tags (comma-separated)
Save Edits
Cancel