dimanche 27 septembre 2015

How render a view of other controller and pass object?

How render a view of other controller and pass object?

For example: In a view controller Post i need render partial from controller Poll, i do the following:

.item_index  
  = f.fields_for :poll_items do |poll|
    = render :partial => 'polls/poll_item_fields', f: poll
  .links
    = link_to_add_association 'Add more', f, :poll_items, render_options: {class: 'links'}

and get error: **Showing /home/ubuntu/workspace/app/views/polls/_poll_item_fields.html.haml where line #3 raised:

undefined local variable or method `f' for #<#:0x0000000f56b170>**

Aucun commentaire:

Enregistrer un commentaire