如何将HTML输入转换为form_for?

时间:2013-06-23 15:03:39

标签: ruby-on-rails ruby ruby-on-rails-3 input

我想把它变成Rails form_for

<input type="text" class="auto" data-a-sign="$ "> 

我目前正在使用HAML,我的代码如下所示:

= form_for @foto,:url => products_path, :html => { :multipart => true } do |f|

  %p
    = f.label :price
    = f.text_field :price
  %p.button
    = f.submit

1 个答案:

答案 0 :(得分:1)

我以为我刚才回答了同样的问题。无论如何,我的回答是:

= text_field_tag "currency", nil, class: "auto", data: { a_sign: "$ " }