Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rails3.1 and formtastic 2.0.0.rc2 - undefined method `inputs'

I am using rails 3.1.0.rc3 with formtastic 2.0.0.rc2 and I am getting this error -

undefined method `inputs' for #<ActionView::Helpers::FormBuilder:0x000001059c2fb0>

Here is the block of code

 = form_tag '#', :class => 'formtastic' do
  = fields_for CustomFields::Field.new, :builder => Formtastic::Helpers::FormHelper.builder do |g|
    = g.inputs :name => :attributes do
      = g.input :_alias
      = g.input :hint
      = g.input :text_formatting, :as => 'select', :collection => options_for_text_formatting, :include_blank => false, :wrapper_html => { :style => 'display: none' }
      = g.input :target, :as => 'select', :collection => options_for_association_target, :include_blank => false, :wrapper_html => { :style => 'display: none' }

Is this a bug ?

Thanks, Alex

like image 775
Alex Avatar asked Nov 19 '25 23:11

Alex


1 Answers

You are trying to use a formtastic method here. When you are actually in a block for Rails's form builder.

You need semantic_form_for and formtastic in your Gemfile to use f.inputs for example..

like image 105
Alex Barlow Avatar answered Nov 22 '25 02:11

Alex Barlow