Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undefined method 'actions' for Formtastic::FormBuilder

I have rails 3.1.3 and formtastic 2.0.2.

I'm using the most basic form you can imagine:

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

I get the following error:

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'

When I comment out f.actions, the form works.

Tried everything I could find, but I'm very much stuck at this point.

like image 430
Fred Fickleberry III Avatar asked Jan 19 '12 14:01

Fred Fickleberry III


1 Answers

Apparently version 2.0.2 of formtastic does not support f.actions. Use f.buttons or upgrade formtastic to 2.1.0.beta1 which I do not recommend you as it is beta and was released some days ago.

like image 78
Nicolas Garnil Avatar answered Sep 22 '22 05:09

Nicolas Garnil