我有一个非常基本的形式:
( SELECT table_owner || '.' || table_name AS table_name
FROM all_tab_modifications
WHERE timestamp >= SYSDATE - 80 AND table_owner IN (
'AXIOM_DATA',
'AXIOM_DATA2',
'AXIOM_META',
'AXIOM_META2'
) AND table_name LIKE 'RPTD_%'
)
MINUS
( SELECT owner || '.' || object_name AS table_name
FROM dba_objects
WHERE created >= SYSDATE - 80 AND owner IN (
'AXIOM_DATA',
'AXIOM_DATA2',
'AXIOM_META',
'AXIOM_META2'
) AND object_name LIKE 'RPTD_%' AND object_type = 'TABLE'
);
当我查看生成的HTML时,我真的很惊讶,因为标签上没有属性“ for”。因此,当我单击复选框标签时,该复选框将不会在我的浏览器中签入:
<%= form_with model: @program, url: program_path, method: :put do |f| %>
<%= f.check_box :new_model %>
<%= f.label :new_model, 'my label'%>
<% end %>
当我使用<form action="/programs/17" accept-charset="UTF-8" method="post">
[ ... ]
<input value="1" name="program[new_model]" type="checkbox">
<label>my label</label>
</form>
代替form_for
时,一切都很好。
我应该如何使Rails在标签上生成form_with
属性?