ref: master
plugins/open_graph/views/open_graph_plugin/myprofile/_track_objects.html.erb
<% tracks = profile.send klass.association %> <% objects.each do |object| %><% track_record = tracks.find{ |t| t.object_type == object } || profile.send(klass.association).build %> <%= f.fields_for klass.association, track_record do |ff| %> <%= ff.hidden_field :id %> <%= ff.hidden_field :tracker_id %> <%= ff.check_box :object_type, {onchange: 'open_graph.track.config.toggleObjectType(this)'}, object, '' %> <%= ff.label :object_type, t("open_graph_plugin.views.track.config.#{track}.objects.#{object}") %> <%= ff.hidden_field :_destroy %> <% end %><% end %>