ruby-on-rails – Formtastic :: FormBuilder的未定义方法’actions’

我有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时,表格有效.

尝试了我能找到的一切,但我在这一点上非常困难.

解决方法

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

相关文章

validates:conclusion,:presence=>true,:inclusion=>{...
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各...
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣...
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 mo...
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表...
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编...