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
                    td = o.input :dec
    = f.button :wrapped, "Create NEO"

我想为o.dec和指定文本o.ra。我怎样才能做到这一点?

4

1 回答 1

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"
于 2013-04-20T17:20:02.980 回答