In one of my partials, I have a selection list to allow the user to
maintain a code against the User model object:
<%= options = [[“Select security question”, “”]] + User::SECURITY_CODES
select(“user”, “security_code”, options) %>
When rendered by the New controller everything is OK. When rendered by
the Edit controller, the “Select security question” is the default
option. I want the the current code displayed as the default. Is there a
recommeded RoR approach, or must I code the options variable as
required.