Retrieving Paperclip attributes for Cocoon in Rails -


i'm trying use cocoon gem paperclip gem in rails. object has_many :attachments, , attachments has_attached_file :attachment_file.

i fields rendered plain text attachment_file.name shown in partial.

the objects rendered this:

          =f.fields_for :attachments |attachment|             =render 'attachment_fields2', f: attachment 

here partial gets rendered inside "object" form:

.row.nested-fields.col-xs-12 tr     .col-xs-12         .form-inline             .col-xs-12.no-padding                 =f.file_field :attachment_file, class:"col-xs-4"                 =attachment.name, class:"col-xs-7"//////this line throws error                 =link_to_remove_association f                     |<i class="fa fa-times col-xs-1"></i> 

any appreciated.

so found out can attributes inside form builder using .object

instead of

=attachment.name, class:"col-xs-7" 

i did

=attachment.object.name 

Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -