Skip to content

Instantly share code, notes, and snippets.

@blackxored
Last active August 29, 2015 14:06
Show Gist options
  • Save blackxored/0db78bbc79cafccfda6c to your computer and use it in GitHub Desktop.
Save blackxored/0db78bbc79cafccfda6c to your computer and use it in GitHub Desktop.
jQuery.get('/people.json', function(people) {
people.forEach(function(person) {
$('<li>' + person.name + '</li>').appendTo('ul')
})
});
class PeopleController < ApplicationController
respond_to :html, :json
def index
@people = Person.all
respond_with @people
end
end
<ul class="people">
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment