:wrapper=> false can`t work with simple_fields_for #219

Closed
openxyz opened this Issue Nov 19, 2012 · 4 comments

2 participants

@openxyz

i want to use a table layout as https://github.com/ryanb/nested_form/wiki/How-To:-Render-nested-fields-inside-a-table, but there is no difference when use :wrapper => false or not with simple_fields_for. it only work as expected with fields_for

i test with 0.3.1 and latest dev

@lest
Collaborator

So it works with fields_for which is also used in the "How To". Is simple_fields_for required to use? Could you please explain your use case?

@openxyz

it is easy and clean to handle validation error with simple_fields_for, and more,as below:
v1

  = f.fields_for :assets,   :wrapper => false do |ff|
      %tr
        %td
          = ff.input_field :asset,as:'file'
          = ff.error :asset,class:'alert-error'  //not good here
          = ff.input :asset_cache, :as => :hidden
        %td
          = ff.input_field :title
          = ff.error :title,class:'alert-error'

v2

  = f.simple_fields_for :assets,  :wrapper => false do |ff|
      %tr
        %td
          = ff.input :asset,as:'file',label:false
          = ff.input :asset_cache, :as => :hidden
        %td
          = ff.input :title
@lest
Collaborator

I still can't understand why simple_fields_for is required. In all my apps fields_for works as good as simple_fields_for when it's inside simple_form_for or nested_simple_form_for.

Could you please push a test application reproducing this issue or give a larger form extraction including form_for? Thanks!

@achempion achempion referenced this issue in plataformatec/simple_form Dec 29, 2012
Closed

some problems with transfer options #718

@achempion achempion referenced this issue in plataformatec/simple_form Dec 29, 2012
Closed

some problems with transfer options #719

@achempion achempion referenced this issue in plataformatec/simple_form Dec 29, 2012
Merged

some problems with transfer options #720

@lest lest added a commit that referenced this issue Mar 13, 2013
@lest lest nested_wrapper option as an alternative to wrapper option
Support this alternative in order to maintain compatibility with
`simple_fields_for` helper (#219)
68485d1
@lest
Collaborator

Fixed in 68485d1 with nested_wrapper option alias.

@lest lest closed this Mar 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment