0
我使用AJAX即可返回這個HTML:與AJAX和Rails返回HTML頁面打印出對象
<%= @groups_list.each do |group| %>
<!--One Group Tile-->
<div class="groups-tile">
<div class="groups-tile-image" style="background:url(img/clubhouse-test.jpg) no-repeat; background-size:cover;">
<%= group.name %>
</div>
<div class="groups-tile-meta">
<div class="margin-top-10 small-text">
40 Members
</div>
<div class="small-gray-text">
Next Event: February 15, 2014
</div>
</div>
</div>
<!--/One Group Tile-->
<% end %>
控制器代碼是這樣的:
render 'pagelayouts/orglist', layout: false
出於某種原因,當我得到的迴應
[#<Org id: 2, created_at: "2014-02-09 20:06:08", updated_at: "2014-02-09 20:06:08", name: "Boys and Girls Club", ppname: nil, ppphone: nil, ppemail: nil, ppskype: nil, approved: nil, username: nil, password: nil, description: nil, timezone: nil, zipcode: 94134>, #<Org id: 3, created_at: "2014-02-09 20:06:53", updated_at: "2014-02-09 20:06:53", name: "Hello Org", ppname: nil, ppphone: nil, ppemail: nil, ppskype: nil, approved: nil, username: nil, password: nil, description: nil, timezone: nil, zipcode: 94118>]
任何想法,爲什麼這可能是:通過AJAX它在文本格式到底這樣粘貼的對象?另外,我該如何解決這個問題?
非常感謝!我真的很沮喪。我會在5分鐘內接受你的回答。 – Arun
偶然發生在我身上。 :P很高興能幫到你。 –