【发布时间】:2014-10-07 17:45:46
【问题描述】:
我尝试使用另一个部分名称来呈现一个集合
在我的 users_controller#index 中,标准列表带有标准 html 请求, 对应视图 users/index.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...
无论如何要改变它?
【问题讨论】:
标签: ruby-on-rails-4 collections render