The intent of the following code is to create a paragraph element containing the dimension_version name of every dimension’s dimension version.
$("#dave").html("<%= Dimension.find(params[:id]).dimension_versions.each do |dv| %><p><%= dv.name %></p><% end %>");
This actually results in the expected behavior, but is followed by the entire record for each dimension version returned, which is unexpected:
Default
Test 1
[#<DimensionVersion id: 3, name: "Default", dimension_id: 2, created_at: "2013-02-01 15:04:05", updated_at: "2013-02-01 15:04:05">, #<DimensionVersion id: 10, name: "Test 1", dimension_id: 2, created_at: "2013-02-01 16:03:55", updated_at: "2013-02-01 16:03:55">]
I had to remove the = from <%=. So this:
Became: