Formtastic :: FormBuilder的未定义方法'actions'

时间:2012-01-19 14:48:18

标签: ruby-on-rails undefined formtastic

我有rails 3.1.3和formtastic 2.0.2。

我正在使用你能想象到的最基本的形式:

 <%= semantic_form_for @customer do |f| %>
   <%= f.inputs %>
   <%= f.actions %>   
 <% end %>

我收到以下错误:

Completed 500 Internal Server Error in 652ms

ActionView::Template::Error (undefined method `actions' for #<Formtastic::FormBuilder:0x00000128249018>):
    2: 
    3: <%= semantic_form_for @customer do |f| %>
    4:     <%= f.inputs %>
    5:     <%= f.actions %>
    6:   <% end %>
  app/views/customers/new.html.erb:5:in `block in _app_views_customers_new_html_erb___3455593051620241935_2485943640'
  app/views/customers/new.html.erb:3:in `_app_views_customers_new_html_erb___3455593051620241935_2485943640'

当我发表评论 f.actions 时,该表单有效。

尝试了我能找到的一切,但我现在非常坚持。

1 个答案:

答案 0 :(得分:16)

显然,formtastic版本2.0.2不支持f.actions。使用f.buttons或将formtastic升级到2.1.0.beta1我不推荐你,因为它是测试版并且几天前发布。