不确定是否有解决方法,我做错了,或者这是简单形式或角度之间的碰撞,但是:
.field = f.input :role, collection: roles.map(&:name), selected: user.role.try(:name), include_blank: 'Select', required: true, input_html: { "ng-model" => "role" }
渲染(看起来正确):
但所选值是include_blank
"选择" 的值.是的,role
是在用户上设置的.