Rails form_for select, invalid selected when disabled: true -
can guys me little problem? select tag:
<%= f.select :department_id, options_for_select(department.in_order.map {|d| [d.name, d.id]}, obj.department_id), { prompt: true }, class: 'form-control input-sm', disabled: lambda {action_name == 'revise'} %>
if disabled: true
set, "department invalid" error on validation. when not set, fine.
this due fact html fields when disabled
not submitted form. need readonly
. readonly gives same functionality disabled still submitted form.
Comments
Post a Comment