表单生成器前缀

时间:2016-06-07 19:37:34

标签: ruby-on-rails forms ruby-on-rails-3 ruby-on-rails-4

我有一个像这样的表格:

<%= form_for People::Selector::GenderReportForm.new, url: selector_download_path do |f| %>

   <%= f.text_field :name %>

   <%= select_month(Date.today, 
       {field_name: 'start_month', 
        prefix: "people_selector_gender_report_form"},
       {class: "form-control"}) %>

<% end %>

从我的角度来看,prefix: "people_selector_gender_report_form"也应该能够从资源中获取:People::Selector::GenderReportForm.new

有没有办法在没有prefix的情况下构建相同的表单?  或者像prefix: f.prefix这样的东西可能吗?感谢

0 个答案:

没有答案