2014-10-07 44 views
0

我尝试呈现的集合,在我users_controller#指数使用另一部分名称轨道4:渲染收集部分与另一名

,标准列表配备了标准的HTML请求, 相应的视图用户/指数.html.ham和部分_user.html.haml

我试图呈现不同的Ajax请求的用户列表中,用不同的部分

index.js.erb 
.... 
$(content).html('<%= j render ("album_owner_index", @collection => @users, as: album_owner) %>'); 

但这不起作用,语法错误,意外',',预计收藏前

,如果我只写

$(content).html('<%= j render("album_owners_index") %>'); 

婷 ')' #然后它使用标准_user.html.haml ...
反正去改变它?

回答

0

我必须在index.ejs.erb

$(content).html('<%= j render("album_owners_index") %>'); 

先使用,然后在部分_album_owners_index.html.haml,我必须呈现@users收集,用为:参数...使用另一个部分而不是_user:

= render :partial => "backoffice/users/album_owner", :collection => @users, as: :album_owner