加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-16 21:18:26 所属栏目:百科 来源:网络整理
导读:我有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 652msActionView::Template::Error (
我有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我不推荐你,因为它是测试版,并在几天前发布.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读