如何将自己的名称添加到输入中,例如一个文本框? 即如何自定义输入旁边显示的输入名称?
这是我的代码:
- title "Add a NEO"
= simple_form_for @neo do |f|
= f.input :name
br
- for obs in @observations do
= simple_form_for obs do |o|
table
tr
td = o.input :ra
td = o.input :dec
= f.button :wrapped, "Create NEO"
我想为o.dec
和o.ra
指定文字。我怎么能这样做?
答案 0 :(得分:0)
- title "Add a NEO"
= simple_form_for @neo do |f|
= f.input :name
br
- for obs in @observations do
= simple_form_for obs do |o|
table
tr
td = o.input :ra, :label => "Right Ascension"
td = o.input :dec, :label => "Declination"
= f.button :wrapped, "Create NEO"